<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <base href="${request.contextPath}/"/>
    <meta name=”renderer” content=”webkit|ie-comp|ie-stand”/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <link rel="icon" href="favicon.ico">

    <title>养老管理-日间照料管理</title>
    <link href="Content/font/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="Content/bootstrap/bootstrap.min.css" rel="stylesheet"/>

    <link rel="stylesheet" type="text/css" href="Content/webuploader/style.css"/>
    <link href="Content/fancybox/jquery.fancybox.css" rel="stylesheet">
    <link href="Content/view/form.css" rel="stylesheet">
    <script src="Content/jquery/jquery-1.10.2.min.js"></script>
    <script src="Content/jquery/jquery.md5.min.js"></script>
    <script src="Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script>
    <script src="Content/laydate/laydate.js"></script>

    <script src="Content/ueditor/ueditor.config.js"></script>
    <script src="Content/ueditor/ueditor.all.min.js"></script>
    <script src="Content/ueditor/lang/zh-cn/zh-cn.js"></script>

    <script src="Content/fancybox/jquery.fancybox.js"></script>
    <script type="text/javascript" src="Content/webuploader/upload.js?version=5.5"></script>
    <script type="text/javascript" src="Content/webuploader/fileupload.js?version=3.8"></script>
    <!--[if lt IE 9]>
    <script src="~/Content/bootstrap/html5shiv.min.js"></script>
    <script src="~/Content/bootstrap/respond.min.js"></script>
    <![endif]-->


    <script>
        //   *LaoNa* 写后台的地址，底下直接饮用
        var controlUrl = '/tblHomeAgedLookafter';

        function request(d) {
            for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) {
                var b = c[a].split("=");
                if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1])
            }
            return ""
        };

        $(function () {
            MARK = "false";
            UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
            UE.Editor.prototype.getActionUrl = function (action) {
                if (action == 'uploadimage') {
                    return "${request.contextPath}/admin/ueditor/uploadUeditor.html?type=image&mark=" + MARK;
                } else if (action == 'uploadfile') {
                    return "${request.contextPath}/admin/ueditor/uploadUeditor.html?type=file";
                } else if (action == 'listimage' || action == 'listfile') {
                    return "${request.contextPath}/admin/ueditor/imageManager.html?picNum=50&insite=false";
                } else if (action == 'uploadvideo') {
                    return "${request.contextPath}/admin/ueditor/uploadUeditor.html?type=media";
                } else if (action == 'catchimage') {
                    return "/jeeadmin/jeecms/ueditor/getRemoteImage.do";
                } else if (action == 'uploadscrawl') {
                    return "/jeeadmin/jeecms/ueditor/scrawlImage.do?Type=Image";
                } else {
                    return this._bkGetActionUrl.call(this, action);
                }
            }
        });
    </script>

</head>

<body class="Firefox 63.0 lr-uitheme-default">
<div id="lr_form_bg" class="lr-form-bg">
</div>

<input type="hidden" id="ywId" value="" class="form-control" />
<input type="hidden" id="id" value="" class="form-control" />
<div class="lr-form-wrap" id="form">
    <div class="col-xs-12 lr-form-item">
        <div><font color="red" face="宋体">重要提示：*使用上传图片功能,禁止修改图片大小格式*</font></div>
    </div>
    <div class="col-xs-12 lr-form-item">
    <div class="lr-form-item-title">标题<font face="宋体">*</font>
    </div>
    <input id="title" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
</div>
<!--    <div class="col-xs-12 lr-form-item">-->
<!--        <div class="lr-form-item-title">发布时间<font face="宋体">*</font>-->
<!--        </div>-->
<!--        <input id="releaseTime" autocomplete="off" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="NotNull" onfocus="WdatePicker()" />-->
<!--    </div>-->
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">来源<font face="宋体">*</font>
        </div>
        <input id="source" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div><div class="col-xs-12 lr-form-item">
    <div class="lr-form-item-title">联系人<font face="宋体">*</font>
    </div>
    <input id="linkman" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
</div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">联系电话<font face="宋体">*</font>
        </div>
        <input id="contactNumber" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">开放时间<font face="宋体">*</font>
        </div>
        <input id="openingHours" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">地址<font face="宋体">*</font>
        </div>
        <input id="site" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/>
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">首页图片<font face="宋体">*</font>
        </div>
        <div id="lookafter" class="uploader"></div>
        <input type="hidden" id="stylepics">
    </div>
    <div class="col-xs-12 lr-form-item">
        <div class="lr-form-item-title">内容<font face="宋体">*</font>
        </div>
        <div id="content" style="height:270px;">
        </div>
    </div>
    <script>
        //*LaoNa* 上传图片用
        $(document).ready(function () {
            path = "";
            $(".fancybox").fancybox({
                openEffect: "none",
                closeEffect: "none",
                helpers: {
                    overlay: {
                        locked: false
                    }
                }
            });

        });

        function upload() {
            var stylepicurl = document.getElementsByName("lookafter");
            var stylepicurls = '';
            for (var i = 0; i < stylepicurl.length; i++) {
                stylepicurls += stylepicurl[i].value + ",";
            }
            $("#stylepics").val(stylepicurls);

        }
    </script>
    <script>
        var acceptClick;
        var keyValue = "";
        var flag;

        var bootstrap = function (a, b) {
            var d = b.frameTab.currentIframe().selectedRow;
            flag = b.frameTab.currentIframe().flag;
            var c = {
                init: function () {
                    c.bind();
                    c.initData()
                },
                bind: function () {
                    // a("#communityid").lrInitSelect();
                    e = UE.getEditor("content");
                    a("#content")[0].ue = e;
                },
                initData: function () {
                    if (!!d) {
                        keyValue = d.id;
                        $("#ywId").val(keyValue);
                        $("#id").val(keyValue);
                        a("#form").lrSetFormData(d);
                        if (flag == "edit") {
                            a.lrSetForm(top.$.rootUrl + controlUrl + "/SaveForm?keyValue=" + keyValue + "&isshow=4", function (f) {
                                $("#stylepics").val(f);
                                $("#lookafter").powerWebUpload({auto: true, fileNum:  $("#stylepics").val(), fileNumLimit: 1, type: "image", fileName: "lookafter"});
                            })
                            e.addListener('ready', function (editor) {
                                e.setContent(d.content)
                            });

                        }
                    }
                    if (flag == "add") {
                        $("#lookafter").powerWebUpload({auto: true, fileNum: 0, fileNumLimit: 1, type: "image", fileName: "lookafter"});
                    }

                }
            };
            acceptClick = function (e) {
                if (!a("#form").lrValidform()) {
                    return false
                }
                var f = a("#form").lrGetFormData(keyValue);
                if (f.parentId == "" || f.parentId == "&nbsp;") {
                    f.parentId = "0"
                }
                f.nature = "Circulationsolicit"
                a.lrSaveForm(top.$.rootUrl + controlUrl + "/SaveForm?keyValue=" + keyValue, f, function (g) {
                    if (!!e) {
                        e()
                    }
                })
            };
            c.init()
        };
    </script>
    <script>


        (function (l, t, o) {
            var m = l([]),
                q = l.resize = l.extend(l.resize, {}),
                u, w = "setTimeout",
                v = "resize",
                p = v + "-special-event",
                n = "delay",
                r = "throttleWindow";
            q[n] = 250;
            q[r] = true;
            l.event.special[v] = {
                setup: function () {
                    if (!q[r] && this[w]) {
                        return false
                    }
                    var a = l(this);
                    m = m.add(a);
                    l.data(this, p, {
                        w: a.width(),
                        h: a.height()
                    });
                    if (m.length === 1) {
                        s()
                    }
                },
                teardown: function () {
                    if (!q[r] && this[w]) {
                        return false
                    }
                    var a = l(this);
                    m = m.not(a);
                    a.removeData(p);
                    if (!m.length) {
                        clearTimeout(u)
                    }
                },
                add: function (a) {
                    if (!q[r] && this[w]) {
                        return false
                    }
                    var c;

                    function b(h, d, e) {
                        var f = l(this),
                            g = l.data(this, p);
                        g.w = d !== o ? d : f.width();
                        g.h = e !== o ? e : f.height();
                        c.apply(this, arguments)
                    }

                    if (l.isFunction(a)) {
                        c = a;
                        return b
                    } else {
                        c = a.handler;
                        a.handler = b
                    }
                }
            };

            function s() {
                u = t[w](function () {
                    m.each(function () {
                        var c = l(this),
                            b = c.width(),
                            a = c.height(),
                            d = l.data(this, p);
                        if (b !== d.w || a !== d.h) {
                            c.trigger(v, [d.w = b, d.h = a])
                        }
                    });
                    s()
                }, q[n])
            }
        })(jQuery, this);
        (function (a) {
            var l = ["wheel", "mousewheel", "DOMMouseScroll", "MozMousePixelScroll"],
                k = ("onwheel" in document || document.documentMode >= 9) ? ["wheel"] : ["mousewheel", "DomMouseScroll", "MozMousePixelScroll"],
                h = Array.prototype.slice,
                f, d;
            if (a.event.fixHooks) {
                for (var c = l.length; c;) {
                    a.event.fixHooks[l[--c]] = a.event.mouseHooks
                }
            }
            var j = a.event.special.mousewheel = {
                setup: function () {
                    if (this.addEventListener) {
                        for (var m = k.length; m;) {
                            this.addEventListener(k[--m], b, false)
                        }
                    } else {
                        this.onmousewheel = b
                    }
                    a.data(this, "mousewheel-line-height", j.getLineHeight(this));
                    a.data(this, "mousewheel-page-height", j.getPageHeight(this))
                },
                teardown: function () {
                    if (this.removeEventListener) {
                        for (var m = k.length; m;) {
                            this.removeEventListener(k[--m], b, false)
                        }
                    } else {
                        this.onmousewheel = null
                    }
                },
                getLineHeight: function (i) {
                    return parseInt(a(i)["offsetParent" in a.fn ? "offsetParent" : "parent"]().css("fontSize"), 10)
                },
                getPageHeight: function (i) {
                    return a(i).height()
                },
                settings: {
                    adjustOldDeltas: true
                }
            };
            a.fn.extend({
                mousewheel: function (i) {
                    return i ? this.bind("mousewheel", i) : this.trigger("mousewheel")
                },
                unmousewheel: function (i) {
                    return this.unbind("mousewheel", i)
                }
            });

            function b(q) {
                var s = q || window.event,
                    m = h.call(arguments, 1),
                    n = 0,
                    o = 0,
                    p = 0,
                    i = 0;
                q = a.event.fix(s);
                q.type = "mousewheel";
                if ("detail" in s) {
                    p = s.detail * -1
                }
                if ("wheelDelta" in s) {
                    p = s.wheelDelta
                }
                if ("wheelDeltaY" in s) {
                    p = s.wheelDeltaY
                }
                if ("wheelDeltaX" in s) {
                    o = s.wheelDeltaX * -1
                }
                if ("axis" in s && s.axis === s.HORIZONTAL_AXIS) {
                    o = p * -1;
                    p = 0
                }
                n = p === 0 ? o : p;
                if ("deltaY" in s) {
                    p = s.deltaY * -1;
                    n = p
                }
                if ("deltaX" in s) {
                    o = s.deltaX;
                    if (p === 0) {
                        n = o * -1
                    }
                }
                if (p === 0 && o === 0) {
                    return
                }
                if (s.deltaMode === 1) {
                    var r = a.data(this, "mousewheel-line-height");
                    n *= r;
                    p *= r;
                    o *= r
                } else {
                    if (s.deltaMode === 2) {
                        var t = a.data(this, "mousewheel-page-height");
                        n *= t;
                        p *= t;
                        o *= t
                    }
                }
                i = Math.max(Math.abs(p), Math.abs(o));
                if (!d || i < d) {
                    d = i;
                    if (g(s, i)) {
                        d /= 40
                    }
                }
                if (g(s, i)) {
                    n /= 40;
                    o /= 40;
                    p /= 40
                }
                n = Math[n >= 1 ? "floor" : "ceil"](n / d);
                o = Math[o >= 1 ? "floor" : "ceil"](o / d);
                p = Math[p >= 1 ? "floor" : "ceil"](p / d);
                q.deltaX = o;
                q.deltaY = p;
                q.deltaFactor = d;
                q.deltaMode = 0;
                m.unshift(q, n, o, p);
                if (f) {
                    clearTimeout(f)
                }
                f = setTimeout(e, 200);
                return (a.event.dispatch || a.event.handle).apply(this, m)
            }

            function e() {
                d = null
            }

            function g(m, i) {
                return j.settings.adjustOldDeltas && m.type === "mousewheel" && i % 120 === 0
            }
        })(window.jQuery);
        (function (a, c, e) {
            var b = null;
            var d = {
                init: function (j, l) {
                    var o = j.attr("id");
                    if (!o) {
                        o = "lr_" + c.newGuid();
                        j.attr("id", o)
                    }
                    j.addClass("lr-scroll-wrap");
                    var f = j.children();
                    var i = a('<div class="lr-scroll-box" id="' + o + '_box" ></div>');
                    j.append(i);
                    i.append(f);
                    var k = a('<div class="lr-scroll-vertical"   ><div class="lr-scroll-vertical-block" id="' + o + '_vertical"></div></div>');
                    j.append(k);
                    var g = a('<div class="lr-scroll-horizontal" ><div class="lr-scroll-horizontal-block" id="' + o + '_horizontal"></div></div>');
                    j.append(g);
                    if (b === null) {
                        b = a('<div style="-moz-user-select: none;-webkit-user-select: none;-ms-user-select: none;-khtml-user-select: none;user-select: none;display: none;position: fixed;top: 0;left: 0;width: 100%;height: 100%;z-index: 9999;cursor: pointer;" ></div>');
                        a("body").append(b)
                    }
                    var p = i.innerHeight();
                    var q = i.innerWidth();
                    var n = j.height();
                    var r = j.width();
                    var m = {
                        id: o,
                        sy: 0,
                        sx: 0,
                        sh: p,
                        sw: q,
                        h: n,
                        w: r,
                        yh: 0,
                        xw: 0,
                        callback: l
                    };
                    j[0].op = m;
                    d.update(j);
                    d.bindEvent(j, i, k, g);
                    i = null;
                    f = null;
                    k = null;
                    g = null;
                    j = null
                },
                bindEvent: function (h, g, i, f) {
                    h.resize(function () {
                        var j = a(this);
                        var l = j[0].op;
                        var k = j.height();
                        var m = j.width();
                        if (k != l.h) {
                            l.h = k;
                            d.updateY(j)
                        }
                        if (m != l.w) {
                            l.w = m;
                            d.updateX(j)
                        }
                        j = null
                    });
                    g.resize(function () {
                        var k = a(this);
                        var j = k.parent();
                        var l = j[0].op;
                        var m = k.innerHeight();
                        var n = k.innerWidth();
                        if (m != l.sh) {
                            l.sh = m;
                            d.updateY(j)
                        }
                        if (n != l.sw) {
                            l.sw = n;
                            d.updateX(j)
                        }
                        k = null;
                        j = null
                    });
                    h.mousewheel(function (p, m, n, o) {
                        var k = 4 + (Math.abs(m) - 1) * 0.8;
                        var j = a(this);
                        var q = j[0].op;
                        var l = m * k;
                        if (q.sh > q.h) {
                            q.oldsy = q.sy;
                            q.sy = q.sy - l;
                            d.moveY(j, true);
                            j = null;
                            return false
                        } else {
                            if (q.sw > q.w) {
                                q.oldsx = q.sx;
                                q.sx = q.sx - l;
                                d.moveX(j, true);
                                j = null;
                                return false
                            }
                        }
                    });
                    i.find(".lr-scroll-vertical-block").on("mousedown", function (k) {
                        b.show();
                        var j = a(this).parent().parent();
                        var l = j[0].op;
                        l.isYMousedown = true;
                        l.yMousedown = k.pageY;
                        j.addClass("lr-scroll-active");
                        j = null
                    });
                    f.find(".lr-scroll-horizontal-block").on("mousedown", function (k) {
                        b.show();
                        var j = a(this).parent().parent();
                        var l = j[0].op;
                        l.isXMousedown = true;
                        l.xMousedown = k.pageX;
                        j.addClass("lr-scroll-active");
                        j = null
                    });
                    top.$(document).on("mousemove", {
                        $obj: h
                    }, function (l) {
                        var m = l.data.$obj[0].op;
                        if (m.isYMousedown) {
                            var o = l.pageY;
                            var k = o - m.yMousedown;
                            m.yMousedown = o;
                            m.oldsy = m.sy;
                            m.blockY = m.blockY + k;
                            if ((m.blockY + m.yh) > m.h) {
                                m.blockY = m.h - m.yh
                            }
                            if (m.blockY < 0) {
                                m.blockY = 0
                            }
                            d.getY(m);
                            d.moveY(l.data.$obj)
                        } else {
                            if (m.isXMousedown) {
                                var m = l.data.$obj[0].op;
                                var n = l.pageX;
                                var j = n - m.xMousedown;
                                m.xMousedown = n;
                                m.oldsx = m.sx;
                                m.blockX = m.blockX + j;
                                if ((m.blockX + m.xw) > m.w) {
                                    m.blockX = m.w - m.xw
                                }
                                if (m.blockX < 0) {
                                    m.blockX = 0
                                }
                                d.getX(m);
                                d.moveX(l.data.$obj)
                            }
                        }
                    }).on("mouseup", {
                        $obj: h
                    }, function (j) {
                        j.data.$obj[0].op.isYMousedown = false;
                        j.data.$obj[0].op.isXMousedown = false;
                        b.hide();
                        j.data.$obj.removeClass("lr-scroll-active")
                    })
                },
                update: function (f) {
                    d.updateY(f);
                    d.updateX(f)
                },
                updateY: function (g) {
                    var k = g[0].op;
                    var f = g.find("#" + k.id + "_box");
                    var h = g.find("#" + k.id + "_vertical");
                    if (k.sh > k.h) {
                        if ((k.sh - k.sy) < k.h) {
                            var i = 0;
                            k.sy = k.sh - k.h;
                            if (k.sy < 0) {
                                k.sy = 0
                            } else {
                                i = 0 - k.sy
                            }
                            f.css("top", i + "px")
                        }
                        var l = parseInt(k.h * k.h / k.sh);
                        l = (l < 30 ? 30 : l);
                        k.yh = l;
                        var j = parseInt(k.sy * (k.h - l) / (k.sh - k.h));
                        if ((j + l) > k.h) {
                            j = k.h - l
                        }
                        if (j < 0) {
                            j = 0
                        }
                        k.blockY = j;
                        h.css({
                            top: j + "px",
                            height: l + "px"
                        })
                    } else {
                        k.blockY = 0;
                        k.sy = 0;
                        f.css("top", "0px");
                        h.css({
                            top: "0px",
                            height: "0px"
                        })
                    }
                    k.callback && k.callback(k.sx, k.sy);
                    f = null;
                    h = null
                },
                updateX: function (h) {
                    var k = h[0].op;
                    var g = h.find("#" + k.id + "_box");
                    var f = h.find("#" + k.id + "_horizontal");
                    if (k.sw > k.w) {
                        if ((k.sw - k.sx) < k.w) {
                            var i = 0;
                            k.sx = k.sw - k.w;
                            if (k.sx < 0) {
                                k.sx = 0
                            } else {
                                i = 0 - k.sx
                            }
                            g.css("left", i + "px")
                        }
                        var l = parseInt(k.w * k.w / k.sw);
                        l = (l < 30 ? 30 : l);
                        k.xw = l;
                        var j = parseInt(k.sx * (k.w - l) / (k.sw - k.w));
                        if ((j + l) > k.w) {
                            j = k.w - l
                        }
                        if (j < 0) {
                            j = 0
                        }
                        k.blockX = j;
                        f.css({
                            left: j + "px",
                            width: l + "px"
                        })
                    } else {
                        k.sx = 0;
                        k.blockX = 0;
                        g.css("left", "0px");
                        f.css({
                            left: "0px",
                            width: "0px"
                        })
                    }
                    k.callback && k.callback(k.sx, k.sy);
                    g = null;
                    f = null
                },
                moveY: function (g, k) {
                    var l = g[0].op;
                    var f = g.find("#" + l.id + "_box");
                    var h = g.find("#" + l.id + "_vertical");
                    var i = 0;
                    if (l.sy < 0) {
                        l.sy = 0
                    } else {
                        if (l.sy + l.h > l.sh) {
                            l.sy = l.sh - l.h;
                            i = 0 - l.sy
                        } else {
                            i = 0 - l.sy
                        }
                    }
                    if (k) {
                        var j = d.getBlockY(l);
                        if (j == 0 && l.sy != 0) {
                            l.sy = 0;
                            i = 0
                        }
                        l.blockY = j;
                        f.css({
                            top: i + "px"
                        });
                        h.css({
                            top: j + "px"
                        })
                    } else {
                        f.css({
                            top: i + "px"
                        });
                        h.css({
                            top: l.blockY + "px"
                        })
                    }
                    l.callback && l.callback(l.sx, l.sy);
                    f = null;
                    h = null
                },
                moveX: function (h, k) {
                    var l = h[0].op;
                    var g = h.find("#" + l.id + "_box");
                    var f = h.find("#" + l.id + "_horizontal");
                    var i = 0;
                    if (l.sx < 0) {
                        l.sx = 0
                    } else {
                        if (l.sx + l.w > l.sw) {
                            l.sx = l.sw - l.w;
                            i = 0 - l.sx
                        } else {
                            i = 0 - l.sx
                        }
                    }
                    if (k) {
                        var j = d.getBlockX(l);
                        if (j == 0 && l.sx != 0) {
                            l.sx = 0;
                            i = 0
                        }
                        l.blockX = j;
                        g.css({
                            left: i + "px"
                        });
                        f.css({
                            left: j + "px"
                        })
                    } else {
                        g.css({
                            left: i + "px"
                        });
                        f.css({
                            left: l.blockX + "px"
                        })
                    }
                    l.callback && l.callback(l.sx, l.sy);
                    g = null;
                    f = null
                },
                getBlockY: function (g) {
                    var f = parseFloat(g.sy * (g.h - g.yh) / (g.sh - g.h));
                    if ((f + g.yh) > g.h) {
                        f = g.h - g.yh
                    }
                    if (f < 0) {
                        f = 0
                    }
                    return f
                },
                getY: function (f) {
                    f.sy = parseInt(f.blockY * (f.sh - f.h) / (f.h - f.yh));
                    if ((f.sy + f.h) > f.sh) {
                        f.sy = f.sh - f.h
                    }
                    if (f.sy < 0) {
                        f.sy = 0
                    }
                },
                getBlockX: function (g) {
                    var f = parseFloat(g.sx * (g.w - g.xw) / (g.sw - g.w));
                    if ((f + g.xw) > g.w) {
                        f = g.w - g.xw
                    }
                    if (f < 0) {
                        f = 0
                    }
                    return f
                },
                getX: function (f) {
                    f.sx = parseInt(f.blockX * (f.sw - f.w) / (f.w - f.xw));
                    if ((f.sx + f.w) > f.sw) {
                        f.sx = f.sw - f.w
                    }
                    if (f.sx < 0) {
                        f.sx = 0
                    }
                },
            };
            a.fn.lrscroll = function (f) {
                a(this).each(function () {
                    var g = a(this);
                    d.init(g, f)
                })
            };
            a.fn.lrscrollSet = function (h, g) {
                switch (h) {
                    case "moveRight":
                        var f = a(this);
                        setTimeout(function () {
                            var i = f[0].op;
                            i.oldsx = i.sx;
                            i.sx = i.sw - i.w;
                            d.moveX(f, true);
                            f = null
                        }, 250);
                        break;
                    case "moveBottom":
                        var f = a(this);
                        setTimeout(function () {
                            var i = f[0].op;
                            i.oldsy = i.sx;
                            i.sy = i.sh - i.h;
                            d.moveY(f, true);
                            f = null
                        }, 250);
                        break
                }
            }
        })(window.jQuery, top.learun, window);
        (function (a, b) {
            a.lrValidformMessage = function (d, e) {
                d.addClass("lr-field-error");
                d.parent().append('<div class="lr-field-error-info" title="' + e + '！"><i class="fa fa-info-circle"></i></div>');
                var f = d.parent().find(".form-item-title").text() + " " + e;
                b.alert.error("表单信息输入有误,请检查！</br>" + f);
                if (d.attr("type") == "lrselect") {
                    d.on("change", function () {
                        c(a(this))
                    })
                } else {
                    if (d.attr("type") == "formselect") {
                        d.on("change", function () {
                            c(a(this))
                        })
                    } else {
                        if (d.hasClass("lr-input-wdatepicker")) {
                            d.on("change", function () {
                                var g = a(this);
                                if (g.val()) {
                                    c(g)
                                }
                            })
                        } else {
                            d.on("input propertychange", function () {
                                var g = a(this);
                                if (g.val()) {
                                    c(g)
                                }
                            })
                        }
                    }
                }
            };
            a.fn.lrRemoveValidMessage = function () {
                c(a(this))
            };
            a.fn.lrValidform = function () {
                upload();
                var e = true;
                var f = b.validator;
                var d = a(this).lrGetFormData();
                a(this).find("[isvalid=yes]").each(function () {
                    var g = a(this);
                    if (g.parent().find(".lr-field-error-info").length > 0) {
                        e = false;
                        return true
                    }
                    var h = a(this).attr("checkexpession");
                    var i = f["is" + h];
                    if (!h || !i) {
                        return false
                    }
                    var j = a(this).attr("errormsg") || "";
                    var k = g.attr("id");
                    var n = d[k];
                    var m = {
                        code: true,
                        msg: ""
                    };
                    if (h == "LenNum" || h == "LenNumOrNull" || h == "LenStr" || h == "LenStrOrNull") {
                        var l = g.attr("length");
                        m = i(n, l)
                    } else {
                        m = i(n)
                    }
                    if (!m.code) {
                        e = false;
                        a.lrValidformMessage(g, j + m.msg)
                    }
                });
                return e
            };

            function c(d) {
                d.removeClass("lr-field-error");
                d.parent().find(".lr-field-error-info").remove()
            }
        })(window.jQuery, top.learun);
        (function (a, b) {
            a.fn.lrGetFormData = function (d) {
                var e = {};
                a(this).find("input,select,textarea,.lr-select,.lr-formselect,.lrUploader-wrap,.lr-radio,.lr-checkbox,.edui-default").each(function (i) {
                    var h = a(this).attr("id");
                    if (!!h) {
                        var j = a(this).attr("type");
                        switch (j) {
                            case "radio":
                                if (a("#" + h).is(":checked")) {
                                    var g = a("#" + h).attr("name");
                                    e[g] = a("#" + h).val()
                                }
                                break;
                            case "checkbox":
                                if (a("#" + h).is(":checked")) {
                                    e[h] = 1
                                } else {
                                    e[h] = 0
                                }
                                break;
                            case "lrselect":
                                e[h] = a(this).lrselectGet();
                                break;
                            case "formselect":
                                e[h] = a(this).lrformselectGet();
                                break;
                            case "lrGirdSelect":
                                e[h] = a(this).lrGirdSelectGet();
                                break;
                            case "lr-Uploader":
                                e[h] = a(this).lrUploaderGet();
                                break;
                            case "lr-radio":
                                e[h] = a(this).find("input:checked").val();
                                break;
                            case "lr-checkbox":
                                var f = [];
                                a(this).find("input:checked").each(function () {
                                    f.push(a(this).val())
                                });
                                e[h] = String(f);
                                break;
                            default:
                                if (a("#" + h).hasClass("currentInfo")) {
                                    var k = a("#" + h)[0].lrvalue;
                                    e[h] = a.trim(k)
                                } else {
                                    if (a(this).hasClass("edui-default")) {
                                        if (a(this)[0].ue) {
                                            e[h] = a(this)[0].ue.getContent(null, null, true)
                                        }
                                    } else {
                                        var k = a("#" + h).val();
                                        e[h] = a.trim(k)
                                    }
                                }
                                break
                        }
                        e[h] += "";
                        if (e[h] == "") {
                            // e[h] = "&nbsp;"
                            e[h] = ""
                        }
                        if (e[h] == "&nbsp;" && !d) {
                            e[h] = ""
                        }
                    }
                });
                return e
            };
            a.fn.lrSetFormData = function (f) {
                var e = a(this);
                for (var g in f) {
                    var k = f[g];
                    var d = e.find("#" + g);
                    if (d.length == 0 && k != null) {
                        d = e.find('[name="' + g + '"][value="' + k + '"]');
                        if (d.length > 0) {
                            if (!d.is(":checked")) {
                                d.trigger("click")
                            }
                        }
                    } else {
                        var i = d.attr("type");
                        if (d.hasClass("lr-input-wdatepicker")) {
                            i = "datepicker"
                        }
                        switch (i) {
                            case "checkbox":
                                var h = 0;
                                if (d.is(":checked")) {
                                    h = 1
                                } else {
                                    h = 0
                                }
                                if (h != parseInt(k)) {
                                    d.trigger("click")
                                }
                                break;
                            case "lrselect":
                                d.lrselectSet(k);
                                break;
                            case "formselect":
                                d.lrformselectSet(k);
                                break;
                            case "lrGirdSelect":
                                d.lrGirdSelectSet(k);
                                break;
                            case "datepicker":
                                d.val(b.formatDate(k, "yyyy-MM-dd"));
                                break;
                            case "lr-Uploader":
                                d.lrUploaderSet(k);
                                break;
                            case "lr-radio":
                                if (!d.find('input[value="' + k + '"]').is(":checked")) {
                                    d.find('input[value="' + k + '"]').trigger("click")
                                }
                                break;
                            default:
                                if (d.hasClass("currentInfo")) {
                                    d[0].lrvalue = k;
                                    if (d.hasClass("currentInfo-user")) {
                                        d.val("");
                                        b.clientdata.getAsync("user", {
                                            key: k,
                                            callback: function (l, m) {
                                                m.obj.val(l.name)
                                            },
                                            obj: d
                                        })
                                    } else {
                                        if (d.hasClass("currentInfo-company")) {
                                            d.val("");
                                            b.clientdata.getAsync("company", {
                                                key: k,
                                                callback: function (l, m) {
                                                    m.obj.val(l.name)
                                                },
                                                obj: d
                                            })
                                        } else {
                                            if (d.hasClass("currentInfo-department")) {
                                                d.val("");
                                                b.clientdata.getAsync("department", {
                                                    key: k,
                                                    callback: function (l, m) {
                                                        m.obj.val(l.name)
                                                    },
                                                    obj: d
                                                })
                                            } else {
                                                d.val(k)
                                            }
                                        }
                                    }
                                } else {
                                    if (d.hasClass("edui-default")) {
                                        var j = d[0].ue;
                                        c(j, k)
                                    } else {
                                        d.val(k)
                                    }
                                }
                                break
                        }
                    }
                }
            };

            function c(d, e) {
                d.ready(function () {
                    d.setContent(e)
                })
            }

            a.lrSetForm = function (e, d) {
                b.loading(true, "正在获取数据");
                b.httpAsyncGet(e, function (f) {
                    b.loading(false);
                    if (f.code == b.httpCode.success) {
                        d(f.data)
                    } else {
                        b.layerClose(window.name);
                        b.alert.error("表单数据获取失败,请重新获取！");
                        b.httpErrorLog(f.info)
                    }
                })
            };
            a.lrSaveForm = function (g, f, d, e) {
                f.__RequestVerificationToken = a.lrToken;
                b.loading(true, "正在保存数据");
                b.httpAsyncPost(g, f, function (h) {
                    b.loading(false);
                    if (h.code == b.httpCode.success) {
                        if (!!d) {
                            d(h)
                        }
                        b.alert.success(h.info);
                        if (!e) {
                            b.layerClose(window.name)
                        }
                    } else {
                        b.alert.error(h.info);
                        b.httpErrorLog(h.info)
                    }
                })
            };
            a.lrPostForm = function (e, d) {
                d.__RequestVerificationToken = a.lrToken;
                b.loading(true, "正在提交数据");
                b.httpAsyncPost(e, d, function (f) {
                    b.loading(false);
                    if (f.code == b.httpCode.success) {
                        b.alert.success(f.info)
                    } else {
                        b.alert.error(f.info);
                        b.httpErrorLog(f.info)
                    }
                })
            };
            a.fn.lrFormTab = function () {
                var d = a(this);
                d.parent().css({
                    "padding-top": "44px"
                });
                d.lrscroll();
                d.on("DOMNodeInserted", function (g) {
                    var f = a(this);
                    var h = 0;
                    f.find("li").each(function () {
                        h += a(this).outerWidth()
                    });
                    f.find(".lr-scroll-box").css({
                        width: h
                    })
                });
                d.delegate("li", "click", {
                    $ul: d
                }, function (i) {
                    var g = a(this);
                    if (!g.hasClass("active")) {
                        var h = g.parent();
                        var f = i.data.$ul.next();
                        var j = g.find("a").attr("data-value");
                        h.find("li.active").removeClass("active");
                        g.addClass("active");
                        f.find(".tab-pane.active").removeClass("active");
                        f.find("#" + j).addClass("active")
                    }
                })
            };
            a.fn.lrFormTabEx = function (e) {
                var d = a(this);
                d.delegate("li", "click", {
                    $ul: d
                }, function (i) {
                    var g = a(this);
                    if (!g.hasClass("active")) {
                        var h = g.parent();
                        var f = i.data.$ul.next();
                        var j = g.find("a").attr("data-value");
                        h.find("li.active").removeClass("active");
                        g.addClass("active");
                        f.find(".tab-pane.active").removeClass("active");
                        f.find("#" + j).addClass("active");
                        if (!!e) {
                            e(j)
                        }
                    }
                })
            };
            a.lrExistField = function (g, e, i, h) {
                var d = a("#" + e);
                if (!d.val()) {
                    return false
                }
                var f = {
                    keyValue: g
                };
                f[e] = d.val();
                a.extend(f, h);
                b.httpAsync("GET", i, f, function (j) {
                    if (j == false) {
                        a.lrValidformMessage(d, "已存在,请重新输入")
                    }
                })
            };
            a.fn.lrDataItemSelect = function (h) {
                var e = {
                    allowSearch: false,
                    param: {
                        itemCode: "",
                        parentId: "0"
                    },
                };
                h = h || {};
                if (!h.code) {
                    return a(this)
                }
                e.param.itemCode = h.code;
                e.param.parentId = h.parentId || "0";
                e.allowSearch = h.allowSearch;
                var f = [];
                if (!!h.childId) {
                    var g = [];
                    a("#" + h.childId).lrselect({
                        allowSearch: e.allowSearch
                    });
                    e.select = function (i) {
                        if (!i) {
                            a("#" + h.childId).lrselectRefresh({
                                data: []
                            })
                        } else {
                            g = [];
                            b.clientdata.getAllAsync("dataItem", {
                                code: e.param.itemCode,
                                callback: function (j) {
                                    a.each(j, function (k, l) {
                                        if (l.parentId == i.k) {
                                            g.push({
                                                id: l.text,
                                                text: l.value,
                                                title: l.text,
                                                k: k
                                            })
                                        }
                                    });
                                    a("#" + h.childId).lrselectRefresh({
                                        data: g
                                    })
                                }
                            })
                        }
                    }
                }
                var d = a(this).lrselect(e);
                b.clientdata.getAllAsync("dataItem", {
                    code: e.param.itemCode,
                    callback: function (i) {
                        a.each(i, function (j, k) {
                            if (k.parentId == e.param.parentId) {
                                f.push({
                                    id: k.value,
                                    text: k.text,
                                    title: k.text,
                                    k: j
                                })
                            }
                        });
                        d.lrselectRefresh({
                            data: f
                        })
                    }
                });
                return d
            };
            a.fn.lrDataSourceSelect = function (f) {
                f = f || {};
                var e = {
                    allowSearch: true,
                    select: f.select,
                };
                if (!f.code) {
                    return a(this)
                }
                var d = a(this).lrselect(e);
                b.clientdata.getAllAsync("sourceData", {
                    code: f.code,
                    callback: function (g) {
                        d.lrselectRefresh({
                            value: f.value,
                            text: f.text,
                            title: f.text,
                            data: g
                        })
                    }
                });
                return d
            };
            a.fn.lrInitSelect = function (h) {
                var f = {
                    allowSearch: true,
                    url: top.$.rootUrl + "/pccontrol/basics/village/GetTree",
                    param: {
                        parentId: "0"
                    }
                };
                h = h || {};
                var j = a(this);
                j.lrselect(f);


            };

            a.fn.lrRadioCheckbox = function (f) {
                var e = {
                    type: "radio",
                    dataType: "dataItem",
                    code: "",
                    text: "itemName",
                    value: "itemValue"
                };
                a.extend(e, f || {});
                var d = a(this);
                d.addClass(e.type);
                d.addClass("lr-" + e.type);
                d.attr("type", "lr-" + e.type);
                var g = d.attr("id");
                if (e.dataType == "dataItem") {
                    b.clientdata.getAllAsync("dataItem", {
                        code: e.code,
                        callback: function (h) {
                            a.each(h, function (j, k) {
                                var i = a('<label><input name="' + g + '" value="' + k.value + '" type="' + e.type + '">' + k.text + "</label>");
                                d.append(i)
                            });
                            d.find("input").eq(0).trigger("click")
                        }
                    })
                } else {
                    b.clientdata.getAllAsync("sourceData", {
                        code: e.code,
                        callback: function (h) {
                            a.each(h, function (j, k) {
                                var i = a('<label><input name="' + g + '" value="' + k[e.value] + '"" type="' + e.type + '">' + k[e.text] + "</label>");
                                d.append(i)
                            });
                            d.find("input").eq(0).trigger("click")
                        }
                    })
                }
            };
            a.fn.lrMultipleQuery = function (h, g, i) {
                var d = a(this);
                var f = d.html();
                d.addClass("lr-query-wrap");
                var e = "";
                e += '<div class="lr-query-btn"><i class="fa fa-search"></i>&nbsp;多条件查询</div>';
                e += '<div class="lr-query-content">';
                e += f;
                e += '<div class="lr-query-arrow"><div class="lr-query-inside"></div></div>';
                e += '<div class="lr-query-content-bottom">';
                e += '<a id="lr_btn_queryReset" class="btn btn-default">&nbsp;重&nbsp;&nbsp;置</a>';
                e += '<a id="lr_btn_querySearch" class="btn btn-primary">&nbsp;查&nbsp;&nbsp;询</a>';
                e += "</div>";
                e += "</div>";
                d.html(e);
                d.find(".lr-query-formcontent").show();
                d.find(".lr-query-content").css({
                    width: i || 400,
                    height: g || 300
                });
                d.find(".lr-query-btn").on("click", function () {
                    var j = d.find(".lr-query-content");
                    if (j.hasClass("active")) {
                        j.removeClass("active")
                    } else {
                        j.addClass("active")
                    }
                });
                d.find("#lr_btn_querySearch").on("click", function () {
                    var j = d.find(".lr-query-content");
                    var k = j.lrGetFormData();
                    j.removeClass("active");
                    h(k)
                });
                d.find("#lr_btn_queryReset").on("click", function () {
                    var j = d.find(".lr-query-content");
                    var l = j.lrGetFormData();
                    for (var k in l) {
                        l[k] = ""
                    }
                    j.lrSetFormData(l)
                });
                a(document).click(function (k) {
                    var l = k.target || k.srcElement;
                    var j = a(l);
                    if (!j.hasClass("lr-query-wrap") && j.parents(".lr-query-wrap").length <= 0) {
                        a(".lr-query-content").removeClass("active")
                    }
                })
            }
        })(jQuery, top.learun);
        (function (e, f) {
            var d = function (c, b) {
                var a;
                this.$element = e(c);
                this.options = e.extend({}, e.fn.wizard.defaults, b);
                this.currentStep = 1;
                this.numSteps = this.$element.find("li").length;
                this.$prevBtn = $("#" + this.$element[0].id + "-actions").find("a.btn-prev");
                this.$nextBtn = $("#" + this.$element[0].id + "-actions").find("a.btn-next");
                a = this.$nextBtn.children().detach();
                this.nextText = e.trim(this.$nextBtn.text());
                this.$nextBtn.append(a);
                this.$prevBtn.on("click", e.proxy(this.previous, this));
                this.$nextBtn.on("click", e.proxy(this.next, this));
                this.$element.on("click", "li.complete", e.proxy(this.stepclicked, this));
                this.$stepContainer = this.$element.data("target") || "body";
                this.$stepContainer = e(this.$stepContainer)
            };
            d.prototype = {
                constructor: d,
                setState: function () {
                    var w = (this.currentStep > 1);
                    var x = (this.currentStep === 1);
                    var a = (this.currentStep === this.numSteps);
                    this.$prevBtn.attr("disabled", (x === true || w === false));
                    var q = this.$nextBtn.data();
                    if (q && q.last) {
                        this.lastText = q.last;
                        if (typeof this.lastText !== "undefined") {
                            var u = (a !== true) ? this.nextText : this.lastText;
                            var c = this.$nextBtn.children().detach();
                            this.$nextBtn.text(u).append(c)
                        }
                    }
                    var s = this.$element.find("li");
                    s.removeClass("active").removeClass("complete");
                    var v = "li:lt(" + (this.currentStep - 1) + ")";
                    var p = this.$element.find(v);
                    p.addClass("complete");
                    var b = "li:eq(" + (this.currentStep - 1) + ")";
                    var t = this.$element.find(b);
                    t.addClass("active");
                    var r = t.data().target;
                    this.$stepContainer.find(".step-pane").removeClass("active");
                    e(r).addClass("active");
                    this.$element.trigger("changed")
                },
                stepclicked: function (i) {
                    var a = e(i.currentTarget);
                    var c = this.$element.find("li").index(a);
                    var b = e.Event("change");
                    this.$element.trigger(b, {
                        step: c + 1,
                        direction: "stepclicked",
                        currentStep: c + 1
                    });
                    if (b.isDefaultPrevented()) {
                        return
                    }
                    this.currentStep = (c + 1);
                    this.setState()
                },
                previous: function () {
                    var a = (this.currentStep > 1);
                    if (a) {
                        var b = e.Event("change");
                        this.$element.trigger(b, {
                            step: this.currentStep,
                            direction: "previous",
                            currentStep: this.currentStep - 1
                        });
                        if (b.isDefaultPrevented()) {
                            return
                        }
                        this.currentStep -= 1;
                        this.setState()
                    }
                },
                next: function () {
                    var c = (this.currentStep + 1 <= this.numSteps);
                    var a = (this.currentStep === this.numSteps);
                    if (c) {
                        var b = e.Event("change");
                        this.$element.trigger(b, {
                            step: this.currentStep,
                            direction: "next",
                            currentStep: this.currentStep + 1
                        });
                        if (b.isDefaultPrevented()) {
                            return
                        }
                        this.currentStep += 1;
                        this.setState()
                    } else {
                        if (a) {
                            this.$element.trigger("finished")
                        }
                    }
                },
                selectedItem: function (a) {
                    return {
                        step: this.currentStep
                    }
                }
            };
            e.fn.wizard = function (b, h) {
                var c;
                var a = this.each(function () {
                    var l = e(this);
                    var k = l.data("wizard");
                    var g = typeof b === "object" && b;
                    if (!k) {
                        l.data("wizard", (k = new d(this, g)))
                    }
                    if (typeof b === "string") {
                        c = k[b](h)
                    }
                });
                return (c === f) ? a : c
            };
            e.fn.wizard.defaults = {};
            e.fn.wizard.Constructor = d;
            e(function () {
                e("body").on("mousedown.wizard.data-api", ".wizard", function () {
                    var a = e(this);
                    if (a.data("wizard")) {
                        return
                    }
                    a.wizard(a.data())
                })
            })
        })(window.jQuery);
        (function (a, b) {
            a.lrtree = {
                getItem: function (f, d) {
                    var c = f.split(".");
                    var g = d.data;
                    for (var e = 0; e < c.length; e++) {
                        if (e == 0) {
                            g = g[c[e]]
                        } else {
                            g = g.childNodes[c[e]]
                        }
                    }
                    return g
                },
                render: function (d) {
                    var g = d[0]._lrtree.dfop;
                    var e = a('<ul class="lr-tree-root" ></ul>');
                    var f = g.data.length;
                    for (var h = 0; h < f; h++) {
                        var c = a.lrtree.renderNode(g.data[h], 0, h, g);
                        e.append(c)
                    }
                    d.append(e);
                    d.lrscroll();
                    g = null
                },
                renderNode: function (v, p, w, q) {
                    if (v.shide) {
                        return ""
                    }
                    v._deep = p;
                    v._path = w;
                    var u = v.id.replace(/[^\w]/gi, "_");
                    var x = v.title || v.text;
                    var g = a('<li class="lr-tree-node"></li>');
                    var h = a('<div id="' + q.id + "_" + u + '" tpath="' + w + '" title="' + x + '"  dataId="' + q.id + '"  class="lr-tree-node-el" ></div>');
                    if (v.hasChildren) {
                        var o = (v.isexpand || q.isAllExpand) ? "lr-tree-node-expanded" : "lr-tree-node-collapsed";
                        h.addClass(o)
                    } else {
                        h.addClass("lr-tree-node-leaf")
                    }
                    var i = a('<span class="lr-tree-node-indent"></span>');
                    if (p == 1) {
                        i.append('<img class="lr-tree-icon" src="' + q.cbiconpath + 's.gif"/>')
                    } else {
                        if (p > 1) {
                            i.append('<img class="lr-tree-icon" src="' + q.cbiconpath + 's.gif"/>');
                            for (var r = 1; r < p; r++) {
                                i.append('<img class="lr-tree-icon" src="' + q.cbiconpath + 's.gif"/>')
                            }
                        }
                    }
                    h.append(i);
                    var f = a('<img class="lr-tree-ec-icon" src="' + q.cbiconpath + 's.gif"/>');
                    h.append(f);
                    if (v.showcheck) {
                        if (v.checkstate == null || v.checkstate == undefined) {
                            v.checkstate = 0
                        }
                        var d = a('<img  id="' + q.id + "_" + u + '_cb" + class="lr-tree-node-cb" src="' + q.cbiconpath + q.icons[v.checkstate] + '" />');
                        h.append(d)
                    }
                    if (v.icon != -1) {
                        if (!!v.icon) {
                            h.append('<i class="' + v.icon + '"></i>&nbsp;')
                        } else {
                            if (v.hasChildren) {
                                if (v.isexpand || q.isAllExpand) {
                                    h.append('<i class="fa fa-folder-open" style="width:15px">&nbsp;</i>')
                                } else {
                                    h.append('<i class="fa fa-folder" style="width:15px">&nbsp;</i>')
                                }
                            } else {
                                h.append('<i class="fa fa-file-o"></i>&nbsp;')
                            }
                        }
                    }
                    var n = '<a class="lr-tree-node-anchor" href="javascript:void(0);">';
                    n += '<span data-value="' + v.id + '" class="lr-tree-node-text" >' + v.text + "</span>";
                    n += "</a>";
                    h.append(n);
                    h.on("click", a.lrtree.nodeClick);
                    if (!v.complete) {
                        h.append('<div class="lr-tree-loading"><img class="lr-tree-ec-icon" src="' + q.cbiconpath + 'loading.gif"/></div>')
                    }
                    g.append(h);
                    if (v.hasChildren) {
                        var m = a('<ul  class="lr-tree-node-ct" >');
                        if (!v.isexpand && !q.isAllExpand) {
                            m.css("display", "none")
                        }
                        if (v.childNodes) {
                            var t = v.childNodes.length;
                            for (var s = 0; s < t; s++) {
                                v.childNodes[s].parent = v;
                                var e = a.lrtree.renderNode(v.childNodes[s], p + 1, w + "." + s, q);
                                m.append(e)
                            }
                            g.append(m)
                        }
                    }
                    v.render = true;
                    q = null;
                    return g
                },
                renderNodeAsync: function (d, i, f) {
                    var e = a('<ul  class="lr-tree-node-ct" >');
                    if (!i.isexpand && !f.isAllExpand) {
                        e.css("display", "none")
                    }
                    if (i.childNodes) {
                        var h = i.childNodes.length;
                        for (var g = 0; g < h; g++) {
                            i.childNodes[g].parent = i;
                            var c = a.lrtree.renderNode(i.childNodes[g], i._deep + 1, i._path + "." + g, f);
                            e.append(c)
                        }
                        d.parent().append(e)
                    }
                    return e
                },
                renderToo: function (d) {
                    var g = d[0]._lrtree.dfop;
                    var e = d.find(".lr-tree-root");
                    e.html("");
                    var f = g.data.length;
                    for (var h = 0; h < f; h++) {
                        var c = a.lrtree.renderNode(g.data[h], 0, h, g);
                        e.append(c)
                    }
                    g = null
                },
                nodeClick: function (i) {
                    var j = i.target || i.srcElement;
                    var f = a(this);
                    var d = a("#" + f.attr("dataId"));
                    var h = d[0]._lrtree.dfop;
                    if (j.tagName == "IMG") {
                        var c = a(j);
                        var g = f.next(".lr-tree-node-ct");
                        if (c.hasClass("lr-tree-ec-icon")) {
                            if (f.hasClass("lr-tree-node-expanded")) {
                                g.slideUp(200, function () {
                                    f.removeClass("lr-tree-node-expanded");
                                    f.addClass("lr-tree-node-collapsed")
                                })
                            } else {
                                if (f.hasClass("lr-tree-node-collapsed")) {
                                    var l = f.attr("tpath");
                                    var k = a.lrtree.getItem(l, h);
                                    if (!k.complete) {
                                        if (!k._loading) {
                                            k._loading = true;
                                            f.find(".lr-tree-loading").show();
                                            b.httpAsync("GET", h.url, {
                                                parentId: k.id
                                            }, function (e) {
                                                if (!!e) {
                                                    k.childNodes = e;
                                                    g = a.lrtree.renderNodeAsync(f, k, h);
                                                    g.slideDown(200, function () {
                                                        f.removeClass("lr-tree-node-collapsed");
                                                        f.addClass("lr-tree-node-expanded")
                                                    });
                                                    k.complete = true;
                                                    f.find(".lr-tree-loading").hide()
                                                }
                                                k._loading = false
                                            })
                                        }
                                    } else {
                                        g.slideDown(200, function () {
                                            f.removeClass("lr-tree-node-collapsed");
                                            f.addClass("lr-tree-node-expanded")
                                        })
                                    }
                                }
                            }
                        } else {
                            if (c.hasClass("lr-tree-node-cb")) {
                                var l = f.attr("tpath");
                                var k = a.lrtree.getItem(l, h);
                                if (k.checkstate == 1) {
                                    k.checkstate = 0
                                } else {
                                    k.checkstate = 1
                                }
                                c.attr("src", h.cbiconpath + h.icons[k.checkstate]);
                                a.lrtree.checkChild(a.lrtree.check, k, k.checkstate, h);
                                a.lrtree.checkParent(a.lrtree.check, k, k.checkstate, h);
                                if (!!h.nodeCheck) {
                                    h.nodeCheck(k, f)
                                }
                            }
                        }
                    } else {
                        var l = f.attr("tpath");
                        var k = a.lrtree.getItem(l, h);
                        h.currentItem = k;
                        a("#" + h.id).find(".lr-tree-selected").removeClass("lr-tree-selected");
                        f.addClass("lr-tree-selected");
                        if (!!h.nodeClick) {
                            h.nodeClick(k, f)
                        }
                    }
                    return false
                },
                check: function (h, n, o, e) {
                    var m = h.checkstate;
                    if (o == 1) {
                        h.checkstate = n
                    } else {
                        var d = h.childNodes;
                        var j = d.length;
                        var c = true;
                        for (var g = 0; g < j; g++) {
                            d[g].checkstate = d[g].checkstate || 0;
                            if ((n == 1 && d[g].checkstate != 1) || n == 0 && d[g].checkstate != 0) {
                                c = false;
                                break
                            }
                        }
                        if (c) {
                            h.checkstate = n
                        } else {
                            h.checkstate = 2
                        }
                    }
                    if (h.render && m != h.checkstate) {
                        var k = h.id.replace(/[^\w]/gi, "_");
                        var f = a("#" + e.id + "_" + k + "_cb");
                        if (f.length == 1) {
                            f.attr("src", e.cbiconpath + e.icons[h.checkstate])
                        }
                    }
                },
                checkParent: function (d, e, h, c) {
                    var f = e.parent;
                    while (f) {
                        var g = d(f, h, 0, c);
                        if (g === false) {
                            break
                        }
                        f = f.parent
                    }
                },
                checkChild: function (e, h, j, d) {
                    if (e(h, j, 1, d) != false) {
                        if (h.childNodes != null && h.childNodes.length > 0) {
                            var c = h.childNodes;
                            for (var f = 0, g = c.length; f < g; f++) {
                                a.lrtree.checkChild(e, c[f], j, d)
                            }
                        }
                    }
                },
                search: function (d, c) {
                    var e = false;
                    a.each(c, function (g, h) {
                        var f = false;
                        if (!b.validator.isNotNull(d).code || h.text.indexOf(d) != -1) {
                            f = true
                        }
                        if (h.hasChildren) {
                            if (a.lrtree.search(d, h.childNodes)) {
                                f = true
                            }
                        }
                        if (f) {
                            e = true;
                            h.isexpand = true;
                            h.shide = false
                        } else {
                            h.shide = true
                        }
                    });
                    return e
                },
                findItem: function (e, f, g) {
                    var d = null;
                    c(e, f, g);

                    function c(h, j, k) {
                        for (var m = 0, n = h.length; m < n; m++) {
                            if (h[m][f] == g) {
                                d = h[m];
                                return true
                            }
                            if (h[m].hasChildren && h[m].childNodes.length > 0) {
                                if (c(h[m].childNodes, j, k)) {
                                    return true
                                }
                            }
                        }
                        return false
                    }

                    return d
                },
                listTotree: function (e, m, g, o, p, d) {
                    var n = [];
                    var k = {};
                    for (var f = 0, j = e.length; f < j; f++) {
                        var h = e[f];
                        k[h[m]] = k[h[m]] || [];
                        k[h[m]].push(h)
                    }
                    c(n, "0");

                    function c(i, v) {
                        var u = k[v] || [];
                        for (var s = 0, t = u.length; s < t; s++) {
                            var q = u[s];
                            var r = {
                                id: q[g],
                                text: q[o],
                                value: q[p],
                                showcheck: d,
                                checkstate: false,
                                hasChildren: false,
                                isexpand: false,
                                complete: true,
                                childNodes: []
                            };
                            if (c(r.childNodes, q[g])) {
                                r.hasChildren = true;
                                r.isexpand = true
                            }
                            i.push(r)
                        }
                        return i.length > 0
                    }

                    return n
                },
                treeTotree: function (f, g, i, j, d, e) {
                    var h = [];
                    c(h, f);

                    function c(q, n) {
                        for (var o = 0, p = n.length; o < p; o++) {
                            var k = n[o];
                            var m = {
                                id: k[g],
                                text: k[i],
                                value: k[j],
                                showcheck: d,
                                checkstate: false,
                                hasChildren: false,
                                isexpand: true,
                                complete: true,
                                childNodes: []
                            };
                            if (k[e].length > 0) {
                                m.hasChildren = true;
                                c(m.childNodes, k[e])
                            }
                            q.push(m)
                        }
                    }

                    return h
                },
                addNode: function (e, i, g, h) {
                    var f = e[0]._lrtree.dfop;
                    if (!!g) {
                        f.data.splice(h, 0, i);
                        var c = a.lrtree.renderNode(i, 0, h, f);
                        if (e.find(".lr-tree-root>li").length == 0) {
                            e.find(".lr-tree-root>li").append(c)
                        } else {
                            e.find(".lr-tree-root>li").eq(h).before(c)
                        }
                    } else {
                        var d = e.find("#" + f.id + "_" + g);
                        var j = d.attr("tpath");
                        var c = a.lrtree.renderNode(i, 0, j + "." + h, f);
                        if (d.next().children().length == 0) {
                            d.next().children().append(c)
                        } else {
                            d.next().children().eq(h).before(c)
                        }
                    }
                },
                setValue: function (c) {
                    var d = c[0]._lrtree.dfop;
                    if (d.data.length == 0) {
                        setTimeout(function () {
                            a.lrtree.setValue(c)
                        }, 100)
                    } else {
                        c.find('span[data-value="' + d._value + '"]').trigger("click")
                    }
                }
            };
            a.fn.lrtree = function (g) {
                var d = {
                    icons: ["checkbox_0.png", "checkbox_1.png", "checkbox_2.png"],
                    method: "GET",
                    url: false,
                    param: null,
                    data: [],
                    isAllExpand: false,
                    cbiconpath: top.$.rootUrl + "/Content/images/learuntree/",
                    nodeClick: false,
                    nodeCheck: false
                };
                a.extend(d, g);
                var c = a(this);
                d.id = c.attr("id");
                if (d.id == null || d.id == "") {
                    d.id = "learuntree" + new Date().getTime();
                    c.attr("id", d.id)
                }
                c.html("");
                c.addClass("lr-tree");
                c[0]._lrtree = {
                    dfop: d
                };
                c[0]._lrtree.dfop.backupData = d.data;
                if (d.url) {
                    b.httpAsync(d.method, d.url, d.param, function (h) {
                        c[0]._lrtree.dfop.data = h || [];
                        c[0]._lrtree.dfop.backupData = c[0]._lrtree.dfop.data;
                        a.lrtree.render(c)
                    })
                } else {
                    a.lrtree.render(c)
                }
                if (d.showcheck) {
                    for (var e = 0; e < 3; e++) {
                        var f = new Image();
                        f.src = d.cbiconpath + d.icons[e]
                    }
                }
                d = null;
                return c
            };
            a.fn.lrtreeSet = function (i, j) {
                var c = a(this);
                var e = c[0]._lrtree.dfop;
                var f = function (p, m, n) {
                    for (var o = 0, q = p.length; o < q; o++) {
                        if (c.find("#" + e.id + "_" + p[o].id.replace(/-/g, "_")).parent().css("display") != "none") {
                            (p[o].showcheck == true && (p[o].checkstate == 1 || p[o].checkstate == 2)) && m.push(n(p[o]));
                            if (!p[o].showcheck || (p[o].showcheck == true && (p[o].checkstate == 1 || p[o].checkstate == 2))) {
                                if (p[o].childNodes != null && p[o].childNodes.length > 0) {
                                    f(p[o].childNodes, m, n)
                                }
                            }
                        }
                    }
                };
                var g = function (p, m, n) {
                    for (var o = 0, q = p.length; o < q; o++) {
                        (p[o].showcheck == true && (p[o].checkstate == 1 || p[o].checkstate == 2) && !p[o].hasChildren) && m.push(n(p[o]));
                        if (!p[o].showcheck || (p[o].showcheck == true && (p[o].checkstate == 1 || p[o].checkstate == 2))) {
                            if (p[o].childNodes != null && p[o].childNodes.length > 0) {
                                g(p[o].childNodes, m, n)
                            }
                        }
                    }
                };
                var l = function (p, m, n) {
                    for (var o = 0, q = p.length; o < q; o++) {
                        if (p[o].showcheck) {
                            p[o].checkstate = 0
                        }
                        if (p[o].childNodes != null && p[o].childNodes.length > 0) {
                            l(p[o].childNodes)
                        }
                    }
                };
                switch (i) {
                    case "allNoCheck":
                        c.find(".lr-tree-node-cb").attr("src", e.cbiconpath + "checkbox_0.png");
                        l(e.data);
                        break;
                    case "allCheck":
                        c.find('.lr-tree-node-cb[src$="checkbox_0.png"]').each(function () {
                            var m = a(this);
                            if (m.parent().parent().find(".lr-tree-node-ct").length == 0) {
                                m.trigger("click")
                            }
                            m = null
                        });
                        break;
                    case "setCheck":
                        var h = j;
                        a.each(h, function (n, o) {
                            var m = c.find("#" + e.id + "_" + o.replace(/-/g, "_"));
                            if (m.next().length == 0) {
                                m.find(".lr-tree-node-cb").trigger("click")
                            }
                        });
                        break;
                    case "setValue":
                        e._value = j;
                        a.lrtree.setValue(c);
                        break;
                    case "currentItem":
                        return e.currentItem;
                        break;
                    case "getCheckNodesEx":
                        var d = [];
                        g(e.data, d, function (m) {
                            return m
                        });
                        return d;
                        break;
                    case "getCheckNodes":
                        var d = [];
                        f(e.data, d, function (m) {
                            return m
                        });
                        return d;
                        break;
                    case "getCheckNodeIds":
                        var d = [];
                        f(e.data, d, function (m) {
                            return m.id
                        });
                        return d;
                        break;
                    case "getCheckNodeIdsByPath":
                        var d = [];
                        var k;
                        f(e.data, d, function (m) {
                            return m.id
                        });
                        return d;
                        break;
                    case "search":
                        a.lrtree.search(j.keyword, e.data);
                        if (b.validator.isNotNull(j.keyword).code) {
                            e._isSearch = true
                        } else {
                            if (e._isSearch) {
                                e._isSearch = false
                            }
                        }
                        a.lrtree.renderToo(c);
                        break;
                    case "refresh":
                        a.extend(e, j || {});
                        if (!!e.url) {
                            b.httpAsync(e.method, e.url, e.param, function (m) {
                                c[0]._lrtree.dfop.data = m || [];
                                c[0]._lrtree.dfop.backupData = c[0]._lrtree.dfop.data;
                                a.lrtree.renderToo(c);
                                e._isSearch = false
                            })
                        } else {
                            c[0]._lrtree.dfop.backupData = c[0]._lrtree.dfop.data;
                            a.lrtree.renderToo(c);
                            e._isSearch = false
                        }
                        break;
                    case "addNode":
                        break;
                    case "updateNode":
                        break
                }
            }
        })(jQuery, top.learun);
        (function (a, b) {
            a(function () {
                a(document).click(function (c) {
                    c = c || Window.event;
                    var d = c.target || c.srcElement;
                    if (d.tagName != "BODY") {
                        a(".lr-select-option").slideUp(150);
                        a(".lr-select").removeClass("lr-select-focus")
                    }
                })
            });
            a.lrselect = {
                htmlToData: function (c) {
                    var e = c[0]._lrselect.dfop;
                    var d = c.find("ul");
                    e.data = [];
                    d.find("li").each(function () {
                        var f = a(this);
                        var g = {
                            id: f.attr("data-value"),
                            text: f.html()
                        };
                        e.data.push(g)
                    });
                    d.remove();
                    d = null;
                    e = null
                },
                calc: function (c, f) {
                    var d = 0;
                    var i = 0;
                    d = a("body").height();
                    i = c.offset().top;
                    var j = i - 1;
                    var e = d - i - 30;
                    var h = 2;
                    if (f.allowSearch) {
                        h += 30
                    }
                    h += f.data.length * 26;
                    if (f.placeholder) {
                        h += 25
                    }
                    if ((f.type === "tree" || f.type === "treemultiple") && f.data.length > 1) {
                        h = 200
                    }
                    h = f.height || h;
                    var g = {
                        type: 0,
                        height: 0
                    };
                    if (e > 130 || e > j || e > h) {
                        g.height = e > h ? h : e
                    } else {
                        g.type = 1;
                        g.height = j > h ? h : j
                    }
                    return g
                },
                initRender: function (h, f) {
                    a("#learun_select_option_" + h.id).remove();
                    var c = a('<div class="lr-select-option" id="learun_select_option_' + h.id + '"></div>');
                    var d = a('<div class="lr-select-option-content"></div>');
                    var g = a('<ul id="learun_select_option_content' + h.id + '"></ul>');
                    c.hide();
                    d.html(g);
                    c.prepend(d);
                    if (h.allowSearch) {
                        var e = a('<div class="lr-select-option-search"><input type="text" placeholder="搜索关键字"><span class="input-query" title="查询"><i class="fa fa-search"></i></span></div>');
                        c.append(e);
                        c.css("padding-bottom", "25px");
                        e.on("click", function () {
                            return false
                        });
                        e.find("input").on("keypress", function (p) {
                            p = p || window.event;
                            if (p.keyCode === 13) {
                                var m = a(this);
                                var r = m.val();
                                var j = m.parents(".lr-select-option");
                                var o = j[0].dfop;
                                if (o.type === "tree" || o.type === "treemultiple") {
                                    var k = m.parent().prev();
                                    k.lrtreeSet("search", {
                                        keyword: r
                                    })
                                } else {
                                    if (o.type === "default" || o.type === "multiple") {
                                        for (var q = 0, s = o.data.length; q < s; q++) {
                                            var n = o.data[q];
                                            if (!r || n[o.text].indexOf(r) != -1) {
                                                n._lrhide = false
                                            } else {
                                                n._lrhide = true
                                            }
                                        }
                                        a.lrselect.render(o)
                                    }
                                }
                                j = null
                            }
                        })
                    }
                    a("body").append(c);
                    c.on("click", a.lrselect.itemClick);
                    c[0].dfop = h;
                    f.append('<div class="lr-select-placeholder" >==' + h.placeholder + "==</div>");
                    f.attr("type", "lrselect").addClass("lr-select");
                    if (h.type != "tree") {
                        d.lrscroll()
                    }
                },
                render: function (c) {
                    switch (c.type) {
                        case "default":
                            a.lrselect.defaultRender(c);
                            break;
                        case "tree":
                        case "treemultiple":
                            a.lrselect.treeRender(c);
                            break;
                        case "gird":
                            break;
                        case "multiple":
                            a.lrselect.multipleRender(c);
                            break;
                        default:
                            break
                    }
                    c.isrender = true
                },
                defaultRender: function (e) {
                    var d = a("#learun_select_option_content" + e.id);
                    d.html("");
                    if (e.placeholder) {
                        d.append('<li data-value="-1" class="lr-selectitem-li" >==' + e.placeholder + "==</li>")
                    }
                    for (var f = 0, h = e.data.length; f < h; f++) {
                        var g = e.data[f];
                        if (!g._lrhide) {
                            var c = a('<li data-value="' + f + '" class="lr-selectitem-li" >' + g[e.text] + "</li>");
                            d.append(c)
                        }
                    }
                },
                multipleRender: function (e) {
                    var d = a("#learun_select_option_content" + e.id);
                    d.html("");
                    if (e.placeholder) {
                        d.append('<li data-value="-1" class="lr-selectitem-li" >==' + e.placeholder + "==</li>")
                    }
                    for (var f = 0, h = e.data.length; f < h; f++) {
                        var g = e.data[f];
                        if (!g._lrhide) {
                            if (!!e.multipleMapValue && e.multipleMapValue[f] != undefined) {
                                var c = a('<li data-value="' + f + '" class="lr-selectitem-li" ><img class="lr-select-node-cb" src="/Content/images/learuntree/checkbox_1.png">' + g[e.text] + "</li>");
                                d.append(c)
                            } else {
                                var c = a('<li data-value="' + f + '" class="lr-selectitem-li" ><img class="lr-select-node-cb" src="/Content/images/learuntree/checkbox_0.png">' + g[e.text] + "</li>");
                                d.append(c)
                            }
                        }
                    }
                },
                treeRender: function (e) {
                    var c = a("#learun_select_option_" + e.id);
                    c.find(".lr-select-option-content").remove();
                    var d = a('<div class="lr-select-option-content"></div>');
                    c.prepend(d);
                    e.data.unshift({
                        id: "-1",
                        text: "==" + e.placeholder + "==",
                        value: "-1",
                        icon: "-1",
                        parentnodes: "0",
                        showcheck: false,
                        isexpand: false,
                        complete: true,
                        hasChildren: false,
                        childNodes: []
                    });
                    var f = {
                        data: e.data,
                        nodeClick: a.lrselect.treeNodeClick
                    };
                    if (e.type === "treemultiple") {
                        f.nodeClick = a.lrselect.treeNodeClick2;
                        f.nodeCheck = a.lrselect.treeNodeCheck
                    }
                    d.lrtree(f)
                },
                bindEvent: function (c) {
                    c.unbind("click");
                    c.on("click", a.lrselect.click)
                },
                click: function (h) {
                    var f = a(this);
                    if (f.attr("readonly") == "readonly" || f.attr("disabled") == "disabled") {
                        return false
                    }
                    var g = f[0]._lrselect.dfop;
                    if (!g.isload) {
                        return false
                    }
                    if (!g.isrender) {
                        a.lrselect.render(g)
                    }
                    h = h || Window.event;
                    var i = h.target || h.srcElement;
                    var c = a(i);
                    var d = a("#learun_select_option_" + g.id);
                    if (d.is(":hidden")) {
                        a(".lr-select").removeClass("lr-select-focus");
                        a(".lr-select-option").slideUp(150);
                        f.addClass("lr-select-focus");
                        var n = g.width || f.parent().width();
                        var j = f.innerHeight();
                        var m = f.offset().top;
                        var k = f.offset().left;
                        var l = a.lrselect.calc(f, g);
                        if (l.type == 0) {
                            d.css({
                                width: n,
                                top: m + j + 2,
                                left: k,
                                height: l.height
                            }).show()
                        } else {
                            d.css({
                                width: n,
                                top: m - l.height - 2,
                                left: k,
                                height: l.height
                            }).show()
                        }
                        d.find(".lr-select-option-search").find("input").select();
                        if (g.type != "multiple") {
                            d.find(".selected").removeClass("selected");
                            if (g._index != -1) {
                                d.find('.lr-selectitem-li[data-value="' + g._index + '"]').addClass("selected")
                            }
                        }
                    } else {
                        d.slideUp(150);
                        f.removeClass("lr-select-focus")
                    }
                    g = null;
                    h.stopPropagation()
                },
                itemClick: function (k) {
                    k = k || Window.event;
                    var l = k.target || k.srcElement;
                    var d = a(l);
                    var g = a(this);
                    var j = g[0].dfop;
                    var h = a("#" + j.id);
                    if (j.type != "multiple") {
                        if (d.hasClass("lr-selectitem-li")) {
                            var i = d.attr("data-value");
                            g.find(".selected").removeClass("selected");
                            d.addClass("selected");
                            if (j._index != i) {
                                var f = h.find(".lr-select-placeholder");
                                if (i == -1) {
                                    f.css("color", "#999");
                                    f.html("==" + j.placeholder + "==")
                                } else {
                                    f.css("color", "#000");
                                    f.html(j.data[i][j.text])
                                }
                                j._index = i;
                                h.trigger("change");
                                if (j.select) {
                                    j.select(j.data[i])
                                }
                            }
                            g.slideUp(150);
                            h.removeClass("lr-select-focus")
                        }
                    } else {
                        if (d.hasClass("lr-selectitem-li") || d.hasClass("lr-select-node-cb")) {
                            var f = h.find(".lr-select-placeholder");
                            var c = d.find(".lr-select-node-cb");
                            var i = d.attr("data-value");
                            if (d.hasClass("lr-select-node-cb")) {
                                c = d;
                                i = d.parent().attr("data-value")
                            }
                            j.multipleMapValue = j.multipleMapValue || {};
                            j.multipleValue = j.multipleValue || [];
                            j.multipleText = j.multipleText || [];
                            if (i == -1) {
                                f.css("color", "#999");
                                f.html("==" + j.placeholder + "==");
                                j.multipleMapValue = {};
                                j.multipleValue = [];
                                j.multipleText = [];
                                g.find('.lr-select-node-cb[src$="checkbox_1.png"]').attr("src", "/Content/images/learuntree/checkbox_0.png");
                                g.slideUp(150);
                                h.removeClass("lr-select-focus")
                            } else {
                                var m = true;
                                if (j.multipleMapValue[i] == undefined) {
                                    f.css("color", "#000");
                                    j.multipleValue.push(j.data[i][j.value]);
                                    j.multipleText.push(j.data[i][j.text]);
                                    j.multipleMapValue[i] = j.data[i];
                                    f.html(String(j.multipleText));
                                    c.attr("src", "/Content/images/learuntree/checkbox_1.png")
                                } else {
                                    j.multipleValue = [];
                                    j.multipleText = [];
                                    delete j.multipleMapValue[i];
                                    a.each(j.multipleMapValue, function (e, n) {
                                        j.multipleValue.push(n[j.value]);
                                        j.multipleText.push(n[j.text])
                                    });
                                    if (j.multipleText.length == 0) {
                                        f.css("color", "#999");
                                        f.html("==" + j.placeholder + "==")
                                    } else {
                                        f.html(String(j.multipleText))
                                    }
                                    m = false;
                                    c.attr("src", "/Content/images/learuntree/checkbox_0.png")
                                }
                                h.trigger("change");
                                if (j.select) {
                                    j.select(j.data[i], m, h)
                                }
                            }
                        }
                    }
                    k.stopPropagation()
                },
                treeNodeClick: function (h, d) {
                    var e = d.parents(".lr-select-option");
                    var g = e[0].dfop;
                    e.slideUp(150);
                    var f = a("#" + g.id);
                    f.removeClass("lr-select-focus");
                    g.currtentItem = h;
                    var c = f.find(".lr-select-placeholder");
                    c.html(g.currtentItem.text);
                    if (h.value == "-1") {
                        c.css("color", "#999")
                    } else {
                        c.css("color", "#000")
                    }
                    f.trigger("change");
                    if (g.select) {
                        g.select(g.currtentItem)
                    }
                    e = null;
                    f = null
                },
                treeNodeClick2: function (i, d) {
                    var g = d.parents(".lr-select-option-content");
                    var e = d.parents(".lr-select-option");
                    var h = e[0].dfop;
                    var f = a("#" + h.id);
                    f.removeClass("lr-select-focus");
                    h.currtentItems = [];
                    if (i.value == "-1") {
                        d.parents(".lr-select-option").slideUp(150);
                        g.lrtreeSet("allNoCheck");
                        var c = f.find(".lr-select-placeholder");
                        c.html(i.text);
                        c.css("color", "#999");
                        f.trigger("change");
                        if (h.select) {
                            h.select([])
                        }
                    }
                    g = null;
                    e = null;
                    f = null
                },
                treeNodeCheck: function (m, d) {
                    var g = d.parents(".lr-select-option-content");
                    var e = d.parents(".lr-select-option");
                    var j = e[0].dfop;
                    var f = a("#" + j.id);
                    var c = f.find(".lr-select-placeholder");
                    f.removeClass("lr-select-focus");
                    var h = g.lrtreeSet("getCheckNodesEx");
                    j.currtentItems = h;
                    var p = "";
                    for (var k = 0, n = h.length; k < n; k++) {
                        var o = h[k];
                        if (p != "") {
                            p += ","
                        }
                        p += o.text
                    }
                    if (p == "") {
                        c.html("==" + j.placeholder + "==");
                        c.css("color", "#999")
                    } else {
                        c.text(p);
                        c.css("color", "#000")
                    }
                    f.trigger("change");
                    if (j.select) {
                        j.select(j.currtentItems)
                    }
                    g = null;
                    e = null;
                    f = null;
                    c = null
                },
                defaultValue: function (d, f) {
                    var e = d[0]._lrselect.dfop;
                    e.currtentItem = null;
                    e._index = -1;
                    var c = d.find(".lr-select-placeholder");
                    c.css("color", "#999");
                    c.html("==" + e.placeholder + "==");
                    a("#" + e.id + " .lr-select-option .selected").removeClass("selected");
                    e.select && e.select(null, f);
                    d.trigger("change")
                }
            };
            a.fn.lrselect = function (e) {
                var d = {
                    placeholder: "请选择",
                    type: "default",
                    value: "id",
                    text: "text",
                    title: "title",
                    width: false,
                    allowSearch: false,
                    url: false,
                    data: false,
                    param: null,
                    method: "GET",
                    select: false,
                    isload: false,
                    isrender: false
                };
                a.extend(d, e || {});
                var c = a(this);
                if (c.length == 0) {
                    return c
                }
                d.id = c.attr("id");
                if (!d.id) {
                    return false
                }
                if (c[0]._lrselect) {
                    return c
                }
                c[0]._lrselect = {
                    dfop: d
                };
                a.lrselect.bindEvent(c);
                if (d.url) {
                    b.httpAsync(d.method, d.url, d.param, function (f) {
                        c[0]._lrselect.dfop.data = f || [];
                        c[0]._lrselect.dfop.backdata = f || [];
                        d.isload = true
                    })
                } else {
                    if (d.data) {
                        d.isload = true;
                        d.backdata = d.data
                    } else {
                        a.lrselect.htmlToData(c);
                        d.isload = true;
                        d.backdata = d.data
                    }
                }
                a.lrselect.initRender(d, c);
                return c
            };
            a.fn.lrselectRefresh = function (e) {
                var c = a(this);
                if (c.length == 0) {
                    return c
                }
                if (!c[0]._lrselect) {
                    return false
                }
                var d = c[0]._lrselect.dfop;
                if (!d) {
                    return false
                }
                a.extend(d, e || {});
                d.isload = false;
                d.isrender = false;
                if (d.url) {
                    b.httpAsync(d.method, d.url, d.param, function (f) {
                        c[0]._lrselect.dfop.data = f || [];
                        c[0]._lrselect.dfop.backdata = f || [];
                        d.isload = true
                    })
                } else {
                    if (d.data) {
                        d.isload = true;
                        d.backdata = d.data
                    }
                }
                if (d._setValue != null && d._setValue != undefined) {
                    c.lrselectSet(d._setValue)
                } else {
                    a.lrselect.defaultValue(c, "refresh")
                }
                return c
            };
            a.fn.lrselectGet = function () {
                var c = a(this);
                if (c.length == 0) {
                    return c
                }
                var d = c[0]._lrselect.dfop;
                var g = "";
                switch (d.type) {
                    case "default":
                        if (d.data[d._index]) {
                            g = d.data[d._index][d.value]
                        }
                        break;
                    case "tree":
                        if (d.currtentItem) {
                            g = d.currtentItem[d.value]
                        }
                        break;
                    case "treemultiple":
                        if (d.currtentItems) {
                            for (var e = 0, f = d.currtentItems.length; e < f; e++) {
                                if (g != "") {
                                    g += ","
                                }
                                g += d.currtentItems[e][d.value]
                            }
                        }
                        break;
                    case "gird":
                        break;
                    case "multiple":
                        d.multipleValue = d.multipleValue || [];
                        return String(d.multipleValue);
                    default:
                        break
                }
                return g
            };
            a.fn.lrselectSet = function (f) {
                var c = a(this);
                if (c.length == 0) {
                    return c
                }
                if (!c[0]._lrselect) {
                    return c
                }
                f = f + "";
                if (f == "" || f == "undefined" || f == "null") {
                    a.lrselect.defaultValue(c);
                    return c
                }
                var e = c[0]._lrselect.dfop;
                e._setValue = null;
                if (!e) {
                    return c
                }
                a("#" + e.id + " .lr-select-option .selected").removeClass("selected");

                function d(m) {
                    if (m.isload == false) {
                        setTimeout(function () {
                            d(m)
                        }, 100)
                    } else {
                        if (m.isload == true) {
                            var j;
                            switch (m.type) {
                                case "default":
                                    for (var n = 0, o = m.data.length; n < o; n++) {
                                        if (m.data[n][m.value] == f) {
                                            m._index = n;
                                            j = m.data[n];
                                            break
                                        }
                                    }
                                    break;
                                case "tree":
                                    j = a.lrtree.findItem(m.data, m.value, f);
                                    m.currtentItem = j;
                                    break;
                                case "treemultiple":
                                    a.lrselect.render(m);
                                    a("#learun_select_option_" + m.id + " .lr-select-option-content").lrtreeSet("setCheck", f.split(","));
                                    return false;
                                case "gird":
                                    break;
                                case "multiple":
                                    m.multipleMapValue = {};
                                    m.multipleValue = [];
                                    m.multipleText = [];
                                    if (m.isrender) {
                                        a("#learun_select_option_" + m.id).find('.lr-select-node-cb[src$="checkbox_1.png"]').attr("src", "/Content/images/learuntree/checkbox_0.png")
                                    }
                                    var k = f.split(",");
                                    for (var n = 0, o = m.data.length; n < o; n++) {
                                        var h = a.inArray(m.data[n][m.value] + "", k);
                                        if (h != -1) {
                                            m.multipleMapValue[n] = m.data[n];
                                            m.multipleValue.push(m.data[n][m.value]);
                                            m.multipleText.push(m.data[n][m.text]);
                                            if (m.isrender) {
                                                a("#learun_select_option_" + m.id).find('[data-value="' + n + '"] .lr-select-node-cb').attr("src", "/Content/images/learuntree/checkbox_1.png")
                                            }
                                            if (m.select) {
                                                m.select(m.data[n], true, c)
                                            }
                                        }
                                    }
                                    if (m.multipleText.length > 0) {
                                        j = m.multipleText
                                    }
                                    break;
                                default:
                                    break
                            }
                            if (j) {
                                if (m.type == "multiple") {
                                    var g = c.find(".lr-select-placeholder");
                                    if (m.multipleText.length > 0) {
                                        g.css("color", "#000")
                                    } else {
                                        g.css("color", "#999")
                                    }
                                    g.html(String(m.multipleText));
                                    c.trigger("change")
                                } else {
                                    var g = c.find(".lr-select-placeholder");
                                    g.html(j[m.text]);
                                    g.css("color", "#000");
                                    c.trigger("change");
                                    if (m.select) {
                                        m.select(j)
                                    }
                                }
                            } else {
                                m._setValue = f
                            }
                        }
                    }
                }

                d(e);
                return c
            };
            a.fn.lrselectGetEx = function () {
                var c = a(this);
                if (c.length == 0) {
                    return c
                }
                var d = c[0]._lrselect.dfop;
                var e = null;
                switch (d.type) {
                    case "default":
                        if (d.data[d._index]) {
                            e = d.data[d._index]
                        }
                        break;
                    case "tree":
                        if (d.currtentItem) {
                            e = d.currtentItem
                        }
                        break;
                    case "treemultiple":
                        if (d.currtentItems) {
                            e = d.currtentItems
                        }
                        break;
                    case "gird":
                        break;
                    case "multiple":
                        e = d.multipleValue || [];
                        break;
                    default:
                        break
                }
                return e
            }
        })(jQuery, top.learun);
        $.fn.lrtimeline = function (e) {
            var b = $(this);
            if (b.length == 0) {
                return b
            }
            b.addClass("lr-timeline");
            var d = $('<div class="lr-timeline-allwrap"></div>');
            var c = $("<ul></ul>");
            var a = $('<li class="lr-timeline-header"><div>当前</div></li>');
            c.append(a);
            $.each(e, function (i, j) {
                var h = $('<li class="lr-timeline-item" ><div class="lr-timeline-wrap" ></div></li>');
                if (i == 0) {
                    h.find("div").addClass("lr-timeline-current")
                }
                var g = h.find(".lr-timeline-wrap");
                var f = $('<div class="lr-timeline-content"><span class="arrow"></span></div>');
                f.append('<div class="lr-timeline-title">' + j.title + "</div>");
                f.append('<div class="lr-timeline-body"><span>' + j.people + "</span>" + j.content + "</div>");
                g.append('<span class="lr-timeline-date">' + j.time + "</span>");
                g.append(f);
                c.append(h)
            });
            c.append('<li class="lr-timeline-ender"><div>开始</div></li>');
            d.html(c);
            b.html(d)
        };
        (function (a, b) {
            a.lrformselect = {
                init: function (d) {
                    var e = d[0]._lrformselect.dfop;
                    d.addClass("lr-formselect");
                    d.attr("type", "formselect");
                    var c = a("<span>" + e.placeholder + '</span><i class="fa ' + e.icon + '"></i><div class="clear-btn" >清空</div>');
                    d.on("click", a.lrformselect.click);
                    d.html(c)
                },
                click: function (h) {
                    var d = a(this);
                    var g = d[0]._lrformselect.dfop;
                    var i = h.target || h.srcElement;
                    var c = a(i);
                    if (c.hasClass("clear-btn")) {
                        g._itemValue = {
                            value: "",
                            text: g.placeholder
                        };
                        d.removeClass("selected");
                        d.find("span").text(g._itemValue.text);
                        if (!!g.select) {
                            g.select(g._itemValue)
                        }
                    } else {
                        var j = g._itemValue ? g._itemValue.value : "";
                        var f = g.layerUrl;
                        if (f.indexOf("?") != -1) {
                            f += "&dfopid=" + g.id
                        } else {
                            f += "?dfopid=" + g.id
                        }
                        f += "&selectValue=" + j;
                        f += "&selectText=" + encodeURI(encodeURI(d.find("span").text()));
                        b.layerForm({
                            id: g.id,
                            title: g.placeholder,
                            url: f,
                            width: g.layerUrlW,
                            height: g.layerUrlH,
                            maxmin: true,
                            callBack: function (e) {
                                return top[e].acceptClick(a.lrformselect.callback)
                            }
                        })
                    }
                },
                callback: function (f, e, g) {
                    var c = a("#" + e);
                    var d = c[0]._lrformselect.dfop;
                    top["lr_selectform_" + e] = {
                        _obj: g
                    };
                    d._itemValue = d._itemValue || {};
                    if (d._itemValue.value != f.value) {
                        if (!!d.select) {
                            d.select(f)
                        }
                        c.trigger("change")
                    }
                    if (f.value == "") {
                        f.text = d.placeholder
                    } else {
                        c.addClass("selected")
                    }
                    c.find("span").text(f.text);
                    d._itemValue = f
                }
            };
            a.fn.lrformselect = function (e) {
                var d = {
                    placeholder: "请选择",
                    icon: "fa-plus",
                    layerUrl: false,
                    layerParam: false,
                    layerUrlW: 600,
                    layerUrlH: 400,
                    dataUrl: null,
                    select: false,
                };
                a.extend(d, e || {});
                var c = a(this);
                d.id = c.attr("id");
                if (!d.id) {
                    return false
                }
                if (!!c[0]._lrformselect) {
                    return c
                }
                c[0]._lrformselect = {
                    dfop: d
                };
                a.lrformselect.init(c);
                return c
            };
            a.fn.lrformselectRefresh = function (e) {
                var c = a(this);
                var d = c[0]._lrformselect.dfop;
                a.extend(d, e || {});
                d._itemValue = null;
                c.find("span").text(d.placeholder)
            };
            a.fn.lrformselectGet = function () {
                var c = a(this);
                var d = c[0]._lrformselect.dfop;
                return d._itemValue ? d._itemValue.value : ""
            };
            a.fn.lrformselectSet = function (e) {
                var c = a(this);
                var d = c[0]._lrformselect.dfop;
                if (e == "") {
                    d._itemValue = {
                        value: "",
                        text: ""
                    };
                    c.removeClass("selected");
                    c.find("span").text(d.placeholder);
                    return false
                }
                d._itemValue = {
                    value: e
                };
                b.httpAsync("GET", d.dataUrl, {
                    keyValue: e
                }, function (f) {
                    if (!!f && f != "") {
                        d._itemValue.text = f;
                        c.addClass("selected");
                        c.find("span").text(f)
                    }
                })
            };
            a.lrGirdSelect = {
                init: function (d) {
                    var e = d[0]._lrGirdSelect.dfop;
                    d.addClass("lr-formselect");
                    d.attr("type", "lrGirdSelect");
                    var c = a("<span>" + e.placeholder + '</span><i class="fa ' + e.icon + '"></i><div class="clear-btn" >清空</div>');
                    d.on("click", a.lrGirdSelect.click);
                    d.html(c);
                    b.httpAsync("GET", e.url, e.param, function (f) {
                        e._loaded = true;
                        e._data = f || []
                    });
                    top.lrGirdSelect = top.lrGirdSelect || {};
                    top.lrGirdSelect[e.id] = e
                },
                click: function (g) {
                    var d = a(this);
                    var f = d[0]._lrGirdSelect.dfop;
                    var h = g.target || g.srcElement;
                    var c = a(h);
                    if (c.hasClass("clear-btn")) {
                        f._itemValue = {
                            value: "",
                            text: f.placeholder
                        };
                        d.removeClass("selected");
                        d.find("span").text(f._itemValue.text);
                        if (!!f.select) {
                            f.select(f._itemValue)
                        }
                    } else {
                        var i = f._itemValue ? f._itemValue.value : "";
                        b.layerForm({
                            id: f.id,
                            title: f.placeholder,
                            url: top.$.rootUrl + "/Utility/GirdSelectIndex?dfopid=" + f.id,
                            width: f.width,
                            height: f.height,
                            maxmin: true,
                            callBack: function (e) {
                                return top[e].acceptClick(a.lrGirdSelect.callback)
                            }
                        })
                    }
                },
                callback: function (f, e) {
                    var c = a("#" + e);
                    var d = c[0]._lrGirdSelect.dfop;
                    d._itemValue = d._itemValue || {};
                    if (d._itemValue[d.value] != f[d.value]) {
                        if (!!d.select) {
                            d.select(f)
                        }
                        c.trigger("change")
                    }
                    if (!f) {
                        f.text = d.placeholder
                    } else {
                        c.addClass("selected")
                    }
                    c.find("span").text(f[d.text]);
                    d._itemValue = f
                }
            };
            a.fn.lrGirdSelect = function (e) {
                var d = {
                    placeholder: "请选择",
                    icon: "fa-plus",
                    url: "",
                    selectWord: "",
                    headData: [],
                    value: "",
                    text: "",
                    width: 600,
                    height: 400,
                    select: false,
                    param: {},
                    _loaded: false
                };
                a.extend(d, e || {});
                var c = a(this);
                d.id = c.attr("id");
                if (!d.id) {
                    return false
                }
                if (!!c[0]._lrGirdSelect) {
                    return c
                }
                c[0]._lrGirdSelect = {
                    dfop: d
                };
                a.lrGirdSelect.init(c);
                return c
            };
            a.fn.lrGirdSelectGet = function () {
                var c = a(this);
                var d = c[0]._lrGirdSelect.dfop;
                d._itemValue = d._itemValue || {};
                var e = d._itemValue[d.value] || "";
                return e
            };
            a.fn.lrGirdSelectSet = function (f) {
                var c = a(this);
                var d = c[0]._lrGirdSelect.dfop;

                function e(g) {
                    if (d._loaded) {
                        a.each(d._data, function (h, i) {
                            if (i[d.value] == g) {
                                if (!!d.select) {
                                    d.select(i)
                                }
                                c.trigger("change");
                                c.addClass("selected");
                                c.find("span").text(i[d.text]);
                                d._itemValue = i;
                                return false
                            }
                        })
                    } else {
                        setTimeout(function () {
                            e(g)
                        }, 100)
                    }
                }

                e(f)
            }
        })(window.jQuery, top.learun);
        (function (a, b) {
            a.lrisearch = {
                init: function (c) {
                    var d = c[0]._lrisearch.dfop;
                    c.parent().append('<div class="lr-isearch-panel"  style="max-height:' + d.maxHeight + 'px;" ><ul id="lrisearch_' + d.id + '" ></ul></div>')
                },
                bind: function (c) {
                    c.on("input propertychange", function () {
                        var d = a(this);
                        a.lrisearch.triggerSearch(c)
                    })
                },
                triggerSearch: function (c) {
                    var f = c[0]._lrisearch.dfop;
                    var d = a("#lrisearch_" + f.id);
                    d.parent().hide();
                    var e = c.val();
                    if (e) {
                        if (!f._isload) {
                            f._isSearchneed = true
                        } else {
                            f._first = true;
                            f._value = e;
                            f._begin = 0;
                            f._end = 100 > f.data.length ? f.data.length : 100;
                            if (f._isSearched) {
                                f._isSearched = false;
                                setTimeout(function () {
                                    a.lrisearch.search(c)
                                })
                            }
                        }
                    } else {
                        f._isSearchneed = false;
                        d.html("")
                    }
                },
                search: function (c) {
                    var g = c[0]._lrisearch.dfop;
                    var k = g._value;
                    var e = g._begin;
                    var h = g._end;
                    var f = g.data;
                    for (var j = e; j < h; j++) {
                        var d = f[j];
                        if (item[g.text].indexOf(k) != -1) {
                            a.lrisearch.renderNone(c, item[g.text])
                        }
                    }
                    if (h < f.length) {
                        g._begin = h;
                        g._end = h + 100;
                        if (g._end > f.length) {
                            g._end = f.length
                        }
                        setTimeout(function () {
                            a.lrisearch.search(c)
                        })
                    } else {
                        g._isSearched = true
                    }
                },
                renderNone: function (c, f) {
                    var e = c[0]._lrisearch.dfop;
                    var d = a("#lrisearch_" + e.id);
                    if (e._first) {
                        e._first = false;
                        d.html("");
                        d.parent().show()
                    }
                    d.append("<li>" + f + "</li>")
                }
            };
            a.fn.lrisearch = function (e) {
                var d = {
                    maxHeight: 200,
                    text: "text",
                    method: "GET",
                    url: "",
                    data: [],
                    param: null,
                    _isload: false,
                    _isSearched: false,
                    _first: false,
                    _isSearchneed: false
                };
                a.extend(d, e || {});
                var c = a(this);
                d.id = c.attr("id");
                if (!d.id) {
                    return false
                }
                c[0]._lrisearch = {
                    dfop: d
                };
                a.lrisearch.init(c);
                if (!!d.url) {
                    b.httpAsync(d.method, d.url, d.param, function (f) {
                        c[0]._lrisearch.dfop.data = f || [];
                        d.isload = true;
                        if (d._isSearchneed) {
                            a.lrisearch.triggerSearch(c)
                        }
                    })
                } else {
                    d.isload = true
                }
                return c
            }
        })(jQuery, top.learun);
        (function (a, b) {
            a.lrUploader = {
                init: function (c) {
                    var d = c[0]._lrUploader.dfop;
                    a.lrUploader.initRender(c, d)
                },
                initRender: function (e, h) {
                    e.attr("type", "lr-Uploader").addClass("lrUploader-wrap");
                    var g = a('<div class="lrUploader-input" ></div>');
                    var c = a('<div class="lrUploader-btn-group"></div>');
                    var f = a('<a id="lrUploader_uploadBtn_' + h.id + '" class="btn btn-success lrUploader-input-btn">上传</a>');
                    var d = a('<a id="lrUploader_downBtn_' + h.id + '" class="btn btn-danger lrUploader-input-btn">下载</a>');
                    e.append(g);
                    c.append(f);
                    c.append(d);
                    e.append(c);
                    f.on("click", a.lrUploader.openUploadForm);
                    d.on("click", a.lrUploader.openDownForm)
                },
                openUploadForm: function () {
                    var c = a(this);
                    var d = c.parents(".lrUploader-wrap");
                    var e = d[0]._lrUploader.dfop;
                    b.layerForm({
                        id: e.id,
                        title: e.placeholder,
                        url: top.$.rootUrl + "/LR_SystemModule/Annexes/UploadForm?keyVaule=" + e.value + "&extensions=" + e.extensions,
                        width: 600,
                        height: 400,
                        maxmin: true,
                        btn: null,
                        end: function () {
                            b.httpAsyncGet(top.$.rootUrl + "/LR_SystemModule/Annexes/GetFileNames?folderId=" + e.value, function (f) {
                                if (f.code == b.httpCode.success) {
                                    a("#" + e.id).find(".lrUploader-input").text(f.info)
                                }
                            })
                        }
                    })
                },
                openDownForm: function () {
                    var c = a(this);
                    var d = c.parents(".lrUploader-wrap");
                    var e = d[0]._lrUploader.dfop;
                    b.layerForm({
                        id: e.id,
                        title: e.placeholder,
                        url: top.$.rootUrl + "/LR_SystemModule/Annexes/DownForm?keyVaule=" + e.value,
                        width: 600,
                        height: 400,
                        maxmin: true,
                        btn: null
                    })
                }
            };
            a.fn.lrUploader = function (e) {
                var c = a(this);
                if (!!c[0]._lrUploader) {
                    return c
                }
                var d = {
                    placeholder: "上传附件",
                    isUpload: true,
                    isDown: true,
                    extensions: ""
                };
                a.extend(d, e || {});
                d.id = c.attr("id");
                d.value = b.newGuid();
                c[0]._lrUploader = {
                    dfop: d
                };
                a.lrUploader.init(c)
            };
            a.fn.lrUploaderSet = function (e) {
                var c = a(this);
                var d = c[0]._lrUploader.dfop;
                d.value = e;
                b.httpAsyncGet(top.$.rootUrl + "/LR_SystemModule/Annexes/GetFileNames?folderId=" + d.value, function (f) {
                    if (f.code == b.httpCode.success) {
                        a("#" + d.id).find(".lrUploader-input").text(f.info)
                    }
                })
            };
            a.fn.lrUploaderGet = function () {
                var c = a(this);
                var d = c[0]._lrUploader.dfop;
                return d.value
            }
        })(jQuery, top.learun);
        (function (a, b) {
            a.lrdate = {
                init: function (k) {
                    var m = k[0]._lrdate.dfop;
                    k.html("");
                    k.addClass("lr-search-date");
                    var l = a('<div class="lr-search-date-text" id="lr_search_date_' + m.id + '" ></div>');
                    var e = a('<div class="lr-search-date-container" id="lr_search_date_container_' + m.id + '"><div class="lr-search-date-arrow"><div class="lr-search-date-inside"></div></div></div>');
                    var c = a('<div class="lr-search-date-content-btns" id="lr_search_date_content_btns_' + m.id + '"></div>');
                    var f = a('<div class="lr-search-date-btn-block"><a href="javascript:;" data-value="customDate">自定义</a></div>');
                    var d = a('<div class="lr-search-date-btn-block"><a href="javascript:;" data-value="clearDate">清空</a></div>');
                    c.append(f);
                    c.append(d);
                    e.append(c);
                    var j = a('<div class="lr-search-date-datepicker-content"></div>');
                    var g = a('<div class="lr-search-date-datepicker-container first" id="lr_search_date_datepicker1_' + m.id + '"  ></div>');
                    var h = a('<div class="lr-search-date-datepicker-container" id="lr_search_date_datepicker2_' + m.id + '"  ></div>');
                    var i = a('<div class="lr-search-date-datepicker-btn"><a class="btn btn-primary">确定</a></div>');
                    j.append(g);
                    j.append(h);
                    j.append(i);
                    e.append(j);
                    k.append(l);
                    k.append(e);
                    laydate.render({
                        elem: "#lr_search_date_datepicker1_" + m.id,
                        position: "static",
                        showBottom: false,
                        theme: "#2F94EE",
                        min: m.minDate || "1900-1-1",
                        max: m.maxDate || "2099-12-31",
                        change: function (o, n) {
                            m._begindate = o + " 00:00:00"
                        }
                    });
                    laydate.render({
                        elem: "#lr_search_date_datepicker2_" + m.id,
                        position: "static",
                        showBottom: false,
                        theme: "#2F94EE",
                        min: m.minDate || "1900-1-1",
                        max: m.maxDate || "2099-12-31",
                        change: function (o, n) {
                            m._enddate = o + " 23:59:59"
                        }
                    });
                    l.on("click", function (r) {
                        var p = a(this);
                        var o = p.parents(".lr-search-date");
                        var q = o[0]._lrdate.dfop;
                        var n = o.find("#lr_search_date_container_" + q.id);
                        if (n.is(":hidden")) {
                            n.show()
                        } else {
                            n.hide()
                        }
                    });
                    a(document).click(function (o) {
                        var p = o.target || o.srcElement;
                        var n = a(p);
                        if (!n.hasClass("lr-search-date") && n.parents(".lr-search-date").length <= 0) {
                            a(".lr-search-date-container").hide()
                        }
                    });
                    f.find("a").on("click", function (q) {
                        var o = a(this);
                        var n = o.parents(".lr-search-date");
                        var p = n[0]._lrdate.dfop;
                        n.find(".lr-search-date-content-btns a.active").removeClass("active");
                        a("#lr_search_date_container_" + p.id).addClass("width");
                        o.addClass("active");
                        n.find(".lr-search-date-datepicker-content").show()
                    });
                    d.find("a").on("click", function (s) {
                        var q = a(this);
                        var o = q.parents(".lr-search-date");
                        var r = o[0]._lrdate.dfop;
                        var n = o.find("#lr_search_date_container_" + r.id);
                        var p = o.find("#lr_search_date_" + r.id);
                        n.hide();
                        o.find(".lr-search-date-content-btns a.active").removeClass("active");
                        p.html("");
                        if (!!r.selectfn) {
                            r.selectfn("1753-01-01", "3000-01-01")
                        }
                    });
                    i.find("a").on("click", function () {
                        var o = a(this).parents(".lr-search-date");
                        var q = o[0]._lrdate.dfop;
                        var n = o.find("#lr_search_date_container_" + q.id);
                        var p = o.find("#lr_search_date_" + q.id);
                        n.hide();
                        var r = b.formatDate(q._begindate, "yyyy-MM-dd") + "~" + b.formatDate(q._enddate, "yyyy-MM-dd");
                        p.html(r);
                        if (!!q.selectfn) {
                            q.selectfn(q._begindate, q._enddate)
                        }
                    })
                },
                monthinit: function (e) {
                    var f = e[0]._lrdate.dfop;
                    var d = a("#lr_search_date_content_btns_" + f.id);
                    var c = a('<div class="lr-search-date-btn-block"></div>');
                    if (f.premShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="preM">上月</a>')
                    }
                    if (f.mShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="currentM">本月</a>')
                    }
                    d.prepend(c);
                    f = null
                },
                jinit: function (e) {
                    var f = e[0]._lrdate.dfop;
                    var d = a("#lr_search_date_content_btns_" + f.id);
                    var c = a('<div class="lr-search-date-btn-block"></div>');
                    if (f.prejShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="preJ">上季度</a>')
                    }
                    if (f.jShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="currentJ">本季度</a>')
                    }
                    d.prepend(c);
                    f = null
                },
                yinit: function (e) {
                    var f = e[0]._lrdate.dfop;
                    var d = a("#lr_search_date_content_btns_" + f.id);
                    var c = a('<div class="lr-search-date-btn-block"></div>');
                    if (f.ysShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="yS">上半年</a>')
                    }
                    if (f.yxShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="yX">下半年</a>')
                    }
                    if (f.preyShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="preY">去年</a>')
                    }
                    if (f.yShow) {
                        c.append('<a href="javascript:;" class="datebtn" data-value="currentY">今年</a>')
                    }
                    d.prepend(c);
                    f = null
                },
                custmerinit: function (e) {
                    var f = e[0]._lrdate.dfop;
                    var d = a("#lr_search_date_content_btns_" + f.id);
                    var c = a('<div class="lr-search-date-btn-block"></div>');
                    for (var g = 0, j = f.dfdata.length; g < j; g++) {
                        var h = f.dfdata[g];
                        if (h) {
                            c.append('<a href="javascript:;" class="datebtn" data-value="' + g + '">' + h.name + "</a>")
                        }
                    }
                    d.prepend(c);
                    f = null
                },
                bindEvent: function (c) {
                    c.find(".datebtn").on("click", function () {
                        var e = a(this);
                        var d = e.parents(".lr-search-date");
                        var f = e.attr("data-value");
                        a.lrdate.select(d, f)
                    })
                },
                select: function (f, n) {
                    var k = f[0]._lrdate.dfop;
                    var e = f.find("#lr_search_date_container_" + k.id);
                    var g = f.find("#lr_search_date_" + k.id);
                    var c = a("#lr_search_date_content_btns_" + k.id);
                    c.find(".active").removeClass("active");
                    var h = c.find('.datebtn[data-value="' + n + '"]').addClass("active");
                    switch (n) {
                        case "preM":
                            var i = b.getPreMonth();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "currentM":
                            var i = b.getMonth();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "preJ":
                            var i = b.getPreQuarter();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "currentJ":
                            var i = b.getCurrentQuarter();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "yS":
                            var i = b.getFirstHalfYear();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "yX":
                            var i = b.getSecondHalfYear();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "preY":
                            var i = b.getPreYear();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        case "currentY":
                            var i = b.getYear();
                            k._begindate = i.begin;
                            k._enddate = i.end;
                            break;
                        default:
                            var m = parseInt(n);
                            var j = k.dfdata[m];
                            k._begindate = j.begin();
                            k._enddate = j.end();
                            break
                    }
                    e.hide();
                    var l = b.formatDate(k._begindate, "yyyy-MM-dd") + "~" + b.formatDate(k._enddate, "yyyy-MM-dd");
                    g.html(l);
                    a("#lr_search_date_container_" + k.id).removeClass("width");
                    f.find(".lr-search-date-datepicker-content").hide();
                    if (!!k.selectfn) {
                        k.selectfn(k._begindate, k._enddate)
                    }
                }
            };
            a.fn.lrdate = function (e) {
                var d = {
                    dfdata: [],
                    mShow: true,
                    premShow: true,
                    jShow: true,
                    prejShow: true,
                    ysShow: true,
                    yxShow: true,
                    preyShow: true,
                    yShow: true,
                    dfvalue: false,
                    selectfn: false,
                    minDate: "",
                    maxDate: "",
                };
                a.extend(d, e || {});
                var c = a(this);
                d.id = c.attr("id");
                if (!d.id) {
                    return false
                }
                c[0]._lrdate = {
                    dfop: d
                };
                a.lrdate.init(c);
                a.lrdate.yinit(c);
                a.lrdate.jinit(c);
                a.lrdate.monthinit(c);
                a.lrdate.custmerinit(c);
                a.lrdate.bindEvent(c);
                if (d.dfvalue != -1) {
                    a.lrdate.select(c, d.dfvalue)
                }
                return c
            };
            window.WdatePicker = function (h) {
                var f = window.event;
                if (f) {
                    var g = f.target || f.srcElement;
                    var c = a(g);
                    if (!c.hasClass("lr-laydate-init")) {
                        h = h || {};
                        h.dateFmt = h.dateFmt || "yyyy-MM-dd";
                        // h.dateFmt = h.dateFmt || "yyyy-MM-dd HH:mm";
                        var d = "date";
                        if (h.dateFmt == "yyyy-MM-dd HH:mm" || h.dateFmt == "yyyy-MM-dd HH:mm:ss") {
                            d = "datetime"
                        }
                        laydate.render({
                            elem: g,
                            trigger: "click",
                            theme: "#2F94EE",
                            format: h.dateFmt,
                            type: d,
                            done: function () {
                                c.trigger("change")
                            }
                        });
                        c.addClass("lr-laydate-init");
                        if (f.type == "click") {
                            setTimeout(function () {
                                c.trigger("click")
                            }, 100);
                            return false
                        }
                    }
                }
            }
        })(jQuery, top.learun);
        (function (a, j) {
            var b = null;
            var d = ["checkbox_0.png", "checkbox_1.png", "checkbox_2.png"];
            var h = top.$.rootUrl + "/Content/images/jfgrid/";
            var f = function (u, y, w, t, v, z) {
                var q = z.left;
                var p = z.frozenleft;
                var r = 0;
                var n = 0;
                var o = false;
                if (y) {
                    q = y.left;
                    r = y.top + 28;
                    n = y.deep + 1;
                    o = y.frozen
                }
                var s = 0;
                var x = u.length;
                a.each(u, function (A, B) {
                    var C = {
                        data: B,
                        height: 28,
                        width: B.width || 100,
                        top: r,
                        left: q,
                        frozen: o,
                        deep: n,
                        last: true,
                        parent: y
                    };
                    if (!y && B.frozen) {
                        C.frozen = true;
                        C.left = p
                    }
                    w.push(C);
                    if (B.children && B.children.length > 0) {
                        C.last = false;
                        C.width = f(B.children, C, w, t, v, z)
                    } else {
                        z.MaxDeep = z.MaxDeep > C.deep ? z.MaxDeep : C.deep;
                        if (C.frozen) {
                            v.push(C)
                        } else {
                            t.push(C)
                        }
                        if (B.isMerge) {
                            z.mergeCols.push(C)
                        }
                        if (B.statistics) {
                            z.isStatistic = true
                        }
                    }
                    if (!y) {
                        if (C.frozen) {
                            p += C.width;
                            z.frozenleft += C.width
                        } else {
                            q += C.width;
                            z.left += C.width
                        }
                    } else {
                        q += C.width
                    }
                    s += C.width
                });
                return s
            };
            var k = function (n, p, o) {
                n._width = n.width + p;
                if (o) {
                    n.$cell.css({
                        width: n._width
                    })
                }
                if (n.parent) {
                    k(n.parent, p)
                }
            };
            var m = function (n, t, s) {
                var u = n.innerWidth();
                var q = t.running.headWidth + t.running.leftWidth;
                if (t.running.cols.length > 0) {
                    var p = t.running.cols[t.running.cols.length - 1];
                    var o = 0;
                    var r = false;
                    if (u > q) {
                        o = u - q + 1;
                        k(p, o, s);
                        r = true
                    } else {
                        if (p._width != undefined) {
                            o = 1;
                            k(p, o, s);
                            r = true
                        }
                    }
                    if (r) {
                        n.find("#jfgrid_head_col_" + t.id).css({
                            width: (t.running.headWidth + o)
                        });
                        if (s) {
                            n.find("#jfgrid_body_" + t.id + ">.lr-scroll-box").css({
                                width: (t.running.headWidth + t.running.leftWidth + o - 1)
                            });
                            n.find("#jfgrid_right_" + t.id).css({
                                width: (t.running.headWidth + o - 1)
                            });
                            n.find("#jfgrid_right_" + t.id + '>[colname="' + p.data.name + '"]').css({
                                width: p._width
                            })
                        }
                    }
                }
            };
            var e = function (x, r, t, u, s) {
                if (x !== 0) {
                    x = x || ""
                }
                if (r.formatter) {
                    var w = r.formatter(x, t, s, u.$cell);
                    u.text = a("<div>" + (w || "") + "</div>").text();
                    u.$cell.attr("title", u.text);
                    var n = u.$cell.find(".jfgrid-data-cell-expend");
                    u.$cell.html(w);
                    u.$cell.prepend(n);
                    if (r.statistics) {
                        u.statisticsNum = u.statisticsNum || 0;
                        s.running.statisticData[r.name] = s.running.statisticData[r.name] || 0;
                        s.running.statisticData[r.name] += (parseFloat(w || 0) - u.statisticsNum);
                        u.statisticsNum = parseFloat(w || 0);
                        a("#jfgrid_statistic_" + s.id + ' [name="' + r.name + '"]').text(s.running.statisticData[r.name])
                    }
                    n = null
                } else {
                    if (r.formatterAsync) {
                        r.formatterAsync(function (z) {
                            u.text = a("<div>" + (z || "") + "</div>").text();
                            u.$cell.attr("title", u.text);
                            var y = u.$cell.find(".jfgrid-data-cell-expend");
                            u.$cell.html(z);
                            u.$cell.prepend(y);
                            y = null;
                            if (r.statistics) {
                                u.statisticsNum = u.statisticsNum || 0;
                                s.running.statisticData[r.name] = s.running.statisticData[r.name] || 0;
                                s.running.statisticData[r.name] += (parseFloat(z || 0) - u.statisticsNum);
                                u.statisticsNum = parseFloat(z || 0);
                                a("#jfgrid_statistic_" + s.id + ' [name="' + r.name + '"]').text(s.running.statisticData[r.name])
                            }
                        }, x, t, s, u.$cell)
                    } else {
                        if (r.edit) {
                            switch (r.edit.type) {
                                case "input":
                                    break;
                                case "select":
                                    if (r.edit.op.data) {
                                        a.each(r.edit.op.data, function (z, A) {
                                            if (A[r.edit.op.value] == x) {
                                                u.text = A[r.edit.op.text];
                                                u.$cell.attr("title", u.text);
                                                var y = u.$cell.find(".jfgrid-data-cell-expend");
                                                u.$cell.html(u.text);
                                                u.$cell.prepend(y);
                                                y = null;
                                                return false
                                            }
                                        });
                                        return
                                    } else {
                                        if (r.edit.datatype === "dataItem") {
                                            j.clientdata.getAsync("dataItem", {
                                                key: x,
                                                code: r.edit.code,
                                                rowItem: u,
                                                callback: function (z, A) {
                                                    A.rowItem.text = z.text;
                                                    A.rowItem.$cell.attr("title", A.rowItem.text);
                                                    var y = A.rowItem.$cell.find(".jfgrid-data-cell-expend");
                                                    A.rowItem.$cell.html(A.rowItem.text);
                                                    A.rowItem.$cell.prepend(y);
                                                    y = null
                                                }
                                            });
                                            return
                                        } else {
                                            if (r.edit.datatype === "dataSource") {
                                                j.clientdata.getAsync("sourceData", {
                                                    key: x,
                                                    keyId: r.edit.op.value,
                                                    code: r.edit.code,
                                                    rowItem: u,
                                                    callback: function (z, A) {
                                                        A.rowItem.text = z[r.edit.op.text];
                                                        A.rowItem.$cell.attr("title", A.rowItem.text);
                                                        var y = A.rowItem.$cell.find(".jfgrid-data-cell-expend");
                                                        A.rowItem.$cell.html(A.rowItem.text);
                                                        A.rowItem.$cell.prepend(y);
                                                        y = null
                                                    }
                                                });
                                                return
                                            }
                                        }
                                    }
                                    break;
                                case "radio":
                                    if (r.edit.data) {
                                        a.each(r.edit.data, function (z, A) {
                                            if (A.id == x) {
                                                u.text = A.text;
                                                u.$cell.attr("title", u.text);
                                                var y = u.$cell.find(".jfgrid-data-cell-expend");
                                                u.$cell.html(u.text);
                                                u.$cell.prepend(y);
                                                y = null;
                                                return false
                                            }
                                        });
                                        return
                                    } else {
                                        if (r.edit.datatype === "dataItem") {
                                            j.clientdata.getAsync("dataItem", {
                                                key: x,
                                                code: r.edit.code,
                                                rowItem: u,
                                                callback: function (z, A) {
                                                    A.rowItem.text = z.text;
                                                    A.rowItem.$cell.attr("title", A.rowItem.text);
                                                    var y = A.rowItem.$cell.find(".jfgrid-data-cell-expend");
                                                    A.rowItem.$cell.html(A.rowItem.text);
                                                    A.rowItem.$cell.prepend(y);
                                                    y = null
                                                }
                                            });
                                            return
                                        } else {
                                            if (r.edit.datatype === "dataSource") {
                                                j.clientdata.getAsync("sourceData", {
                                                    key: x,
                                                    keyText: r.edit.op.text,
                                                    keyId: r.edit.op.value,
                                                    code: r.edit.code,
                                                    rowItem: u,
                                                    callback: function (z, A) {
                                                        A.rowItem.text = z[A.keyText];
                                                        A.rowItem.$cell.attr("title", A.rowItem.text);
                                                        var y = A.rowItem.$cell.find(".jfgrid-data-cell-expend");
                                                        A.rowItem.$cell.html(A.rowItem.text);
                                                        A.rowItem.$cell.prepend(y);
                                                        y = null
                                                    }
                                                });
                                                return
                                            }
                                        }
                                    }
                                    break;
                                case "checkbox":
                                    if (x != undefined && x != null && x != "") {
                                        if (r.edit.data) {
                                            var p = x.split(",");
                                            var q = {};
                                            a.each(p, function (y, z) {
                                                q[z] = "1"
                                            });
                                            var o = [];
                                            a.each(r.edit.data, function (y, z) {
                                                if (q[z.id] == "1") {
                                                    o.push(z.text)
                                                }
                                            });
                                            u.text = String(o);
                                            u.$cell.attr("title", u.text);
                                            var n = u.$cell.find(".jfgrid-data-cell-expend");
                                            u.$cell.html(u.text);
                                            u.$cell.prepend(n);
                                            n = null;
                                            return
                                        } else {
                                            if (r.edit.datatype === "dataItem") {
                                                j.clientdata.getAllAsync("dataItem", {
                                                    code: r.edit.code,
                                                    rowItem: u,
                                                    value: x,
                                                    callback: function (z, A) {
                                                        var C = A.value.split(",");
                                                        var D = {};
                                                        a.each(C, function (E, F) {
                                                            D[F] = "1"
                                                        });
                                                        var B = [];
                                                        a.each(z, function (E, F) {
                                                            if (D[F.value] == "1") {
                                                                B.push(F.text)
                                                            }
                                                        });
                                                        A.rowItem.text = String(B);
                                                        A.rowItem.$cell.attr("title", A.rowItem.text);
                                                        var y = A.rowItem.$cell.find(".jfgrid-data-cell-expend");
                                                        A.rowItem.$cell.html(A.rowItem.text);
                                                        A.rowItem.$cell.prepend(y);
                                                        y = null
                                                    }
                                                });
                                                return
                                            } else {
                                                if (r.edit.datatype === "dataSource") {
                                                    j.clientdata.getAllAsync("sourceData", {
                                                        value: x,
                                                        keyId: r.edit.op.value,
                                                        keyText: r.edit.op.text,
                                                        code: r.edit.code,
                                                        rowItem: u,
                                                        callback: function (z, A) {
                                                            var C = A.value.split(",");
                                                            var D = {};
                                                            a.each(C, function (E, F) {
                                                                D[F] = "1"
                                                            });
                                                            var B = [];
                                                            a.each(z, function (E, F) {
                                                                if (D[F[A.keyId]] == "1") {
                                                                    B.push(F[A.keyText])
                                                                }
                                                            });
                                                            A.rowItem.text = String(B);
                                                            A.rowItem.$cell.attr("title", A.rowItem.text);
                                                            var y = A.rowItem.$cell.find(".jfgrid-data-cell-expend");
                                                            A.rowItem.$cell.html(A.rowItem.text);
                                                            A.rowItem.$cell.prepend(y);
                                                            y = null
                                                        }
                                                    });
                                                    return
                                                }
                                            }
                                        }
                                    }
                                    break;
                                case "datatime":
                                    if (r.edit.dateformat == "0") {
                                        x = j.formatDate(x, "yyyy-MM-dd");
                                        t[r.name] = x
                                    }
                                    break;
                                case "layer":
                                    var v = u.$cell.attr("rowindex");
                                    var n = u.$cell.find(".jfgrid-data-cell-expend");
                                    u.text = x;
                                    u.$cell.attr("title", u.text);
                                    u.$cell.html((x || "") + '<i class="fa fa-ellipsis-h" value="' + v + '" ></i>');
                                    u.$cell.prepend(n);
                                    u.$cell.find(".fa-ellipsis-h")[0].op = r;
                                    u.$cell.find(".fa-ellipsis-h")[0].row = t;
                                    u.$cell.find(".fa-ellipsis-h").on("click", function () {
                                        var y = a(this);
                                        var A = y[0].op;
                                        var z = y[0].row;
                                        var B = y.attr("value");
                                        A.edit.init && A.edit.init(z, y.parent(), B);
                                        top.lrGirdLayerEdit = A;
                                        top.lrGirdLayerEditCallBack = function (C) {
                                            A.edit.change && A.edit.change(z, B, C);
                                            top.lrGirdLayerEdit = null;
                                            top.lrGirdLayerEditCallBack = null
                                        };
                                        if (r.edit.op) {
                                            j.layerForm({
                                                id: "lrgridlayerform",
                                                title: "选择" + r.label,
                                                url: top.$.rootUrl + "/Utility/JfGirdLayerForm",
                                                height: r.edit.op.height || 400,
                                                width: r.edit.op.width || 600,
                                                callBack: function (C) {
                                                    var D = top[C].acceptClick(function (E) {
                                                        A.edit.change && A.edit.change(z, B, E)
                                                    });
                                                    top.lrGirdLayerEdit = null;
                                                    return D
                                                }
                                            })
                                        }
                                        return false
                                    });
                                    return;
                                    break
                            }
                        }
                        var n = u.$cell.find(".jfgrid-data-cell-expend");
                        u.text = x;
                        u.$cell.attr("title", u.text);
                        u.$cell.html(u.text);
                        u.$cell.prepend(n);
                        if (r.statistics) {
                            u.statisticsNum = u.statisticsNum || 0;
                            s.running.statisticData[r.name] = s.running.statisticData[r.name] || 0;
                            s.running.statisticData[r.name] += (parseFloat(u.text || 0) - u.statisticsNum);
                            u.statisticsNum = parseFloat(u.text || 0);
                            a("#jfgrid_statistic_" + s.id + ' [name="' + r.name + '"]').text(s.running.statisticData[r.name])
                        }
                        n = null
                    }
                }
            };
            var l = function (n, o) {
                n.width = n.width + o;
                n.$cell.css({
                    width: n.width
                });
                if (n.parent) {
                    l(n.parent, o)
                }
            };
            var i = function (n, q, o) {
                switch (o.data.edit.type) {
                    case "input":
                        o.$edit = a('<div class="jfgrid-edit-cell"><input id="jfgrid_edit_' + q.id + "_" + o.data.name + '" /></div>');
                        if (o.frozen) {
                            n.find("#jfgrid_left_" + q.id).append(o.$edit)
                        } else {
                            n.find("#jfgrid_right_" + q.id).append(o.$edit)
                        }
                        o.$edit.on("keypress", function (r) {
                            if (event.keyCode == "13") {
                                g()
                            }
                        });
                        break;
                    case "select":
                        o.$edit = a('<div class="jfgrid-edit-cell"><div id="jfgrid_edit_' + q.id + "_" + o.data.name + '" ></div></div>');
                        if (o.frozen) {
                            n.find("#jfgrid_left_" + q.id).append(o.$edit)
                        } else {
                            n.find("#jfgrid_right_" + q.id).append(o.$edit)
                        }
                        o.data.edit.op = o.data.edit.op || {};
                        o.$edit.find("div").lrselect(o.data.edit.op);
                        o.data.edit.op.value = o.$edit.find("div")[0]._lrselect.dfop.value;
                        o.data.edit.op.text = o.$edit.find("div")[0]._lrselect.dfop.text;
                        if (o.data.edit.datatype == "dataItem") {
                            j.clientdata.getAllAsync("dataItem", {
                                code: o.data.edit.code,
                                callback: function (r) {
                                    var s = [];
                                    a.each(r, function (t, u) {
                                        s.push({
                                            id: u.value,
                                            text: u.text,
                                            title: u.text,
                                            k: t
                                        })
                                    });
                                    o.$edit.find("div").lrselectRefresh({
                                        data: s
                                    })
                                }
                            })
                        } else {
                            if (o.data.edit.datatype == "dataSource") {
                                j.clientdata.getAllAsync("sourceData", {
                                    code: o.data.edit.code,
                                    callback: function (r) {
                                        o.$edit.find("div").lrselectRefresh({
                                            data: r
                                        })
                                    }
                                })
                            }
                        }
                        break;
                    case "radio":
                        o.$edit = a('<div class="jfgrid-edit-cell"><div id="jfgrid_edit_' + q.id + "_" + o.data.name + '" class="radio"  ></div></div>');
                        if (o.frozen) {
                            n.find("#jfgrid_left_" + q.id).append(o.$edit)
                        } else {
                            n.find("#jfgrid_right_" + q.id).append(o.$edit)
                        }
                        if (o.data.edit.datatype == "dataItem") {
                            o.$edit.find("div").lrRadioCheckbox({
                                type: "radio",
                                code: o.data.edit.code
                            })
                        } else {
                            if (o.data.edit.datatype == "dataSource") {
                                o.$edit.find("div").lrRadioCheckbox({
                                    type: "radio",
                                    dataType: "dataSource",
                                    code: o.data.edit.code,
                                    text: o.data.edit.text,
                                    value: o.data.edit.value
                                })
                            } else {
                                a.each(o.data.edit.data || [], function (s, t) {
                                    var r = a('<label><input name="jfgrid_edit_' + q.id + "_" + o.data.name + '" value="' + t.id + '"' + (o.data.edit.dfvalue == t.id ? "checked" : "") + ' type="radio">' + t.text + "</label>");
                                    o.$edit.find("div").append(r)
                                })
                            }
                        }
                        break;
                    case "checkbox":
                        o.$edit = a('<div class="jfgrid-edit-cell"><div id="jfgrid_edit_' + q.id + "_" + o.data.name + '" class="checkbox"  ></div></div>');
                        if (o.frozen) {
                            n.find("#jfgrid_left_" + q.id).append(o.$edit)
                        } else {
                            n.find("#jfgrid_right_" + q.id).append(o.$edit)
                        }
                        if (o.data.edit.datatype == "dataItem") {
                            o.$edit.find("div").lrRadioCheckbox({
                                type: "checkbox",
                                code: o.data.edit.code
                            })
                        } else {
                            if (o.data.edit.datatype == "dataSource") {
                                o.$edit.find("div").lrRadioCheckbox({
                                    type: "checkbox",
                                    dataType: "dataSource",
                                    code: o.data.edit.code,
                                    text: o.data.edit.text,
                                    value: o.data.edit.value
                                })
                            } else {
                                a.each(o.data.edit.data || [], function (s, t) {
                                    var r = a('<label><input name="jfgrid_edit_' + q.id + "_" + o.data.name + '" value="' + t.id + '"' + (o.data.edit.dfvalue == t.id ? "checked" : "") + ' type="checkbox">' + t.text + "</label>");
                                    o.$edit.find("div").append(r)
                                })
                            }
                        }
                        break;
                    case "datatime":
                        var p = o.data.edit.dateformat == "0" ? "yyyy-MM-dd" : "yyyy-MM-dd HH:mm";
                        o.$edit = a('<div class="jfgrid-edit-cell"><input id="jfgrid_edit_' + q.id + "_" + o.data.name + '" onClick="WdatePicker({dateFmt:\'' + p + "',qsEnabled:false,isShowClear:false,isShowOK:false,isShowToday:false,onpicked:function(){$('#jfgrid_edit_" + q.id + "_" + o.data.name + '\').trigger(\'change\');}})"  type="text" class="form-control" /></div>');
                        if (o.frozen) {
                            n.find("#jfgrid_left_" + q.id).append(o.$edit)
                        } else {
                            n.find("#jfgrid_right_" + q.id).append(o.$edit)
                        }
                        o.$edit.on("keypress", function (r) {
                            if (event.keyCode == "13") {
                                g()
                            }
                        });
                        break;
                    case "layer":
                        break
                }
            };
            var g = function () {
                a(".jfgrid-layout .jfgrid-edit-cell ").hide();
                a(".jfgrid-layout .lr-select-option").slideUp(150);
                a(".jfgrid-layout .lr-select").removeClass("lr-select-focus")
            };
            var c = {
                init: function (n, o) {
                    if (o.url == "" || o.url == null || o.url == undefined) {
                        o.isPage = false
                    }
                    n.html("");
                    n.addClass("jfgrid-layout");
                    if (b === null) {
                        b = a('<div style="position: fixed;top: 0;left: 0;width: 100%;height: 100%;z-index: 9999;cursor: col-resize;display: none;" ></div>');
                        a("body").append(b)
                    }
                    c.layout(n, o);
                    c.bind(n, o);
                    c.head(n, o);
                    c.dataRender(n, o, o.rowdatas);
                    o = null
                },
                layout: function (t, v) {
                    if (v.height != undefined && v.height != null && v.height > 0) {
                        t.css({
                            height: v.height
                        })
                    }
                    var q = a('<div class="jfgrid-head" id="jfgrid_head_' + v.id + '" ></div>');
                    q.append('<div class="jfgrid-border" id="jfgrid_border_' + v.id + '" ></div>');
                    q.append('<div class="jfgrid-head-col" id="jfgrid_head_col_' + v.id + '" ></div>');
                    t.append(q);
                    var o = a('<div class="jfgrid-body" id="jfgrid_body_' + v.id + '" ></div>');
                    o.append('<div class="jfgrid-left" id="jfgrid_left_' + v.id + '" ></div>');
                    o.append('<div class="jfgrid-right" id="jfgrid_right_' + v.id + '" ></div>');
                    t.append(o);
                    var p = a('<div class="jfgrid-footer" id="jfgrid_footer_' + v.id + '" ></div>');
                    t.append(p);
                    t.append('<div class="jfgrid-move-line" id="jfgrid_move_line_' + v.id + '"  ></div>');
                    o.lrscroll(function (w, z) {
                        if (!t.is(":hidden")) {
                            t.find("#jfgrid_left_" + v.id).css("left", w);
                            t.find("#jfgrid_head_col_" + v.id).css("left", v.running.leftWidth - w);
                            if (v.running.isStatistic) {
                                t.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-right").css("left", -w)
                            }
                            g()
                        }
                    });
                    t.find("#jfgrid_body_" + v.id).append('<div class="jfgrid-nodata-img" id="jfgrid_nodata_img_' + v.id + '"  ><img src="' + top.$.rootUrl + '/Content/images/jfgrid/nodata.jpg"></div>');
                    if (v.isPage) {
                        t.css({
                            "padding-bottom": "35px"
                        });
                        var s = a('<div class="jfgrid-page-bar" id="jfgrid_page_bar_' + v.id + '"><div class="jfgrid-page-bar-info" >无显示数据</div>                <div class="paginations" id="jfgrid_page_bar_nums_' + v.id + '" style="display:none;" >                <ul class="pagination pagination-sm"><li><a href="javascript:void(0);" class="pagebtn">首页</a></li></ul>                <ul class="pagination pagination-sm"><li><a href="javascript:void(0);" class="pagebtn">上一页</a></li></ul>                <ul class="pagination pagination-sm" id="jfgrid_page_bar_num_' + v.id + '" ></ul>                <ul class="pagination pagination-sm"><li><a href="javascript:void(0);" class="pagebtn">下一页</a></li></ul>                <ul class="pagination pagination-sm"><li><a href="javascript:void(0);" class="pagebtn">尾页</a></li></ul>                <ul class="pagination"><li><span></span></li></ul>                <ul class="pagination"><li><input type="text" class="form-control"></li></ul>                <ul class="pagination pagination-sm"><li><a href="javascript:void(0);" class="pagebtn">跳转</a></li></ul>                </div></div>');
                        p.append(s);
                        s.find("#jfgrid_page_bar_num_" + v.id).on("click", c.turnPage);
                        s.find("#jfgrid_page_bar_nums_" + v.id + " .pagebtn").on("click", {
                            op: v
                        }, c.turnPage2);
                        s = null
                    } else {
                        if (v.isEdit) {
                            t.css({
                                "padding-bottom": "29px"
                            });
                            var u = a('<div class="jfgrid-toolbar" id="jfgrid_toolbar_' + v.id + '"></div>');
                            var n = a('<span><i class="fa fa-plus"></i></span>');
                            var r = a('<span><i class="fa fa-minus"></i></span>');
                            n.on("click", function () {
                                var w = {};
                                v.rowdatas.push(w);
                                v.onAddRow && v.onAddRow(w, v.rowdatas);
                                if (v.isTree) {
                                    c.rowRender(t, v, {
                                        data: w,
                                        childRows: []
                                    }, 0, 1)
                                } else {
                                    c.rowRender(t, v, w, 0)
                                }
                                t.find("#jfgrid_nodata_img_" + v.id).hide()
                            });
                            r.on("click", function () {
                                var x = false;
                                var y = true;
                                if (v.isMultiselect) {
                                    var w = [];
                                    a.each(v.running.rowdata, function (z, A) {
                                        if (A.jfcheck.value == 1) {
                                            y = true;
                                            if (v.beforeMinusRow) {
                                                y = v.beforeMinusRow(A.jfgridRowData)
                                            }
                                            if (y) {
                                                v.rowdatas.splice(v.rowdatas.indexOf(A.jfgridRowData), 1);
                                                w.push(A.jfgridRowData);
                                                x = true
                                            }
                                        }
                                    });
                                    if (x) {
                                        v.onMinusRow && v.onMinusRow(w, v.rowdatas)
                                    }
                                } else {
                                    if (v.running.rowSelected != null) {
                                        y = true;
                                        if (v.beforeMinusRow) {
                                            y = v.beforeMinusRow(v.running.rowSelected.jfgridRowData)
                                        }
                                        if (y) {
                                            v.rowdatas.splice((v.running.rowSelected.jfnum.value - 1), 1);
                                            x = true;
                                            v.onMinusRow && v.onMinusRow(v.running.rowSelected, v.rowdatas);
                                            v.running.rowSelected = null
                                        }
                                    }
                                }
                                if (x) {
                                    c.dataRender(t, v, v.rowdatas)
                                }
                                if (v.running.rowdata.length == 0) {
                                    t.find("#jfgrid_nodata_img_" + v.id).show()
                                }
                            });
                            u.append(n);
                            u.append(r);
                            p.append(u);
                            u = null
                        }
                    }
                    q = null;
                    o = null;
                    p = null
                },
                bind: function (n, o) {
                    n.on("click", function (r) {
                        var q = a(this);
                        var t = q[0].dfop;
                        var s = r.target || r.srcElement;
                        var p = a(s);
                        if (!p.hasClass("jfgrid-edit-cell") && p.parents(".jfgrid-edit-cell").length == 0) {
                            g()
                        }
                        if (t.running.isWidhChanging) {
                            dfop.isWidhChanging = false
                        } else {
                            if (p.hasClass("jfgrid-head-cell") || p.parents(".jfgrid-head-cell").length > 0) {
                                if (!p.hasClass("jfgrid-head-cell")) {
                                    p = p.parents(".jfgrid-head-cell")
                                }
                                c.sortCol(q, p, t)
                            } else {
                                if (p.attr("colname") == "jfgrid_subGrid" || p.parent().attr("colname") == "jfgrid_subGrid") {
                                    c.expandSub(q, p, t)
                                } else {
                                    if (p.parent().hasClass("jfgrid-data-cell-expend")) {
                                        c.expandTree(p, t)
                                    } else {
                                        if (p.hasClass("jfgrid-data-cell") || p.parents(".jfgrid-data-cell").length > 0) {
                                            c.clickRow(q, p, t);
                                            r.stopPropagation()
                                        } else {
                                            if (p.attr("id") == ("jfgrid_all_cb_" + t.id)) {
                                                c.checkAllRows(q, p, t)
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    });
                    n.on("dblclick", function (r) {
                        var q = a(this);
                        var t = q[0].dfop;
                        var s = r.target || r.srcElement;
                        var p = a(s);
                        if (p.hasClass("jfgrid-data-cell") || p.parents(".jfgrid-data-cell").length > 0) {
                            t.dblclick && t.dblclick(t.running.rowSelected.jfgridRowData)
                        }
                    });
                    n.on("mouseover", function (r) {
                        var q = a(this);
                        q.find(".jfgrid-data-cell-over").removeClass("jfgrid-data-cell-over");
                        var s = r.target || r.srcElement;
                        var p = a(s);
                        if (p.hasClass("jfgrid-data-cell") || p.parents(".jfgrid-data-cell").length > 0) {
                            var t = p.attr("rownum");
                            if (!t) {
                                t = p.parents(".jfgrid-data-cell").attr("rownum")
                            }
                            q.find('[rownum="' + t + '"]').addClass("jfgrid-data-cell-over")
                        }
                    });
                    n.resize(function () {
                        var p = a(this);
                        var q = p[0].dfop;
                        m(p, q, true);
                        var r = p.find("#jfgrid_body_" + q.id).width();
                        p.find(".jfgrid-sub").css({
                            width: r
                        })
                    });
                    n.delegate(".jfgrid-heed-move", "mousedown", {
                        op: o
                    }, function (r) {
                        b.show();
                        var s = r.data.op;
                        s.running.moveing = true;
                        s.running.xMousedown = r.pageX;
                        var p = a("#jfgrid_move_line_" + s.id);
                        var t = parseInt(a(this).parent().attr("path"));
                        var q = s.running.headData[t];
                        s.running.moveCol = q;
                        s.running.moveWidth = q._width || q.width;
                        s.running.moveLineLeft = q.left + s.running.moveWidth + s.running.leftWidth;
                        if (q.frozen) {
                            s.running.moveLineLeft = s.running.moveLineLeft - s.running.frozenleft
                        }
                        p.css({
                            left: s.running.moveLineLeft
                        }).show()
                    });
                    top.$(document).on("mousemove", {
                        $obj: n
                    }, function (q) {
                        var s = q.data.$obj[0].dfop;
                        var u = q.pageX;
                        if (s.running.moveing) {
                            var p = q.data.$obj.find("#jfgrid_move_line_" + s.id);
                            var t = s.running.moveWidth + (u - s.running.xMousedown);
                            t = (t < 40 ? 40 : t);
                            var r = s.running.moveLineLeft + (t - s.running.moveWidth);
                            p.css({
                                left: r
                            })
                        }
                    }).on("mouseup", {
                        $obj: n
                    }, function (s) {
                        var v = s.data.$obj[0].dfop;
                        if (v.running.moveing) {
                            v.running.moveing = false;
                            var z = s.pageX;
                            if (v.running.moveCol) {
                                var y = v.running.moveWidth + (z - v.running.xMousedown);
                                y = (y < 40 ? 40 : y);
                                var q = y - v.running.moveWidth;
                                if (q != 0) {
                                    l(v.running.moveCol, q);
                                    if (v.running.moveCol.frozen) {
                                        v.running.frozenleft += q;
                                        v.running.leftWidth += q;
                                        s.data.$obj.find("#jfgrid_head_" + v.id).css({
                                            "padding-left": v.running.leftWidth
                                        });
                                        s.data.$obj.find("#jfgrid_border_" + v.id).css({
                                            width: v.running.leftWidth
                                        });
                                        s.data.$obj.find("#jfgrid_head_col_" + v.id).css({
                                            left: v.running.leftWidth
                                        });
                                        s.data.$obj.find("#jfgrid_body_" + v.id + ">.lr-scroll-box").css({
                                            "padding-left": v.running.leftWidth
                                        });
                                        s.data.$obj.find("#jfgrid_left_" + v.id).css({
                                            width: v.running.leftWidth
                                        });
                                        s.data.$obj.find("#jfgrid_left_" + v.id + '>[colname="' + v.running.moveCol.data.name + '"]').css({
                                            width: v.running.moveCol.width
                                        });
                                        if (v.running.isStatistic) {
                                            s.data.$obj.find("#jfgrid_statistic_" + v.id).css({
                                                "padding-left": v.running.leftWidth
                                            });
                                            s.data.$obj.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-left").css({
                                                width: v.running.leftWidth
                                            });
                                            s.data.$obj.find("#jfgrid_statistic_" + v.id + ' [name="' + v.running.moveCol.data.name + '"]').css({
                                                width: v.running.moveCol.width
                                            })
                                        }
                                    } else {
                                        v.running.headWidth += q;
                                        v.running.left += q;
                                        s.data.$obj.find("#jfgrid_head_col_" + v.id).css({
                                            width: v.running.headWidth
                                        });
                                        s.data.$obj.find("#jfgrid_right_" + v.id).css({
                                            width: v.running.headWidth
                                        });
                                        s.data.$obj.find("#jfgrid_right_" + v.id + '>[colname="' + v.running.moveCol.data.name + '"]').css({
                                            width: v.running.moveCol.width
                                        });
                                        if (v.running.isStatistic) {
                                            s.data.$obj.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-right").css({
                                                width: v.running.headWidth
                                            });
                                            s.data.$obj.find("#jfgrid_statistic_" + v.id + ' [name="' + v.running.moveCol.data.name + '"]').css({
                                                width: v.running.moveCol.width
                                            })
                                        }
                                    }
                                    var w = parseInt(v.running.moveCol.$cell.attr("path"));
                                    for (var t = w + 1, u = v.running.headData.length; t < u; t++) {
                                        var r = v.running.headData[t];
                                        if (r.frozen && v.running.moveCol.frozen) {
                                            r.left += q;
                                            r.$cell.css({
                                                left: r.left + v.running.leftWidth - v.running.frozenleft
                                            });
                                            s.data.$obj.find("#jfgrid_left_" + v.id + '>[colname="' + r.data.name + '"]').css({
                                                left: r.left + v.running.leftWidth - v.running.frozenleft
                                            });
                                            if (v.running.isStatistic) {
                                                s.data.$obj.find("#jfgrid_statistic_" + v.id + ' [name="' + r.data.name + '"]').css({
                                                    left: r.left + v.running.leftWidth - v.running.frozenleft
                                                })
                                            }
                                        } else {
                                            if (!r.frozen && !v.running.moveCol.frozen) {
                                                r.left += q;
                                                r.$cell.css({
                                                    left: r.left
                                                });
                                                s.data.$obj.find("#jfgrid_right_" + v.id + '>[colname="' + r.data.name + '"]').css({
                                                    left: r.left
                                                });
                                                if (v.running.isStatistic) {
                                                    s.data.$obj.find("#jfgrid_statistic_" + v.id + ' [name="' + r.data.name + '"]').css({
                                                        left: r.left
                                                    })
                                                }
                                            }
                                        }
                                    }
                                    m(s.data.$obj, v, true)
                                }
                                v.running.moveCol = null
                            }
                            b.hide();
                            var p = s.data.$obj.find("#jfgrid_move_line_" + v.id);
                            p.hide()
                        }
                    })
                },
                head: function (q, v) {
                    v.running.MaxDeep = 0;
                    v.running.headWidth = 0;
                    v.running.headHeight = 0;
                    v.running.leftWidth = 0;
                    v.running.left = 0;
                    v.running.frozenleft = 0;
                    v.running.cols = [];
                    v.running.frozenCols = [];
                    v.running.mergeCols || [];
                    v.running.headData = [];
                    f(v.headData, false, v.running.headData, v.running.cols, v.running.frozenCols, v.running);
                    if (v.running.isStatistic) {
                        v.running.statisticData = {};
                        q.find("#jfgrid_footer_" + v.id).append('<div class="jfgrid-statistic" id="jfgrid_statistic_' + v.id + '"><div class="jfgrid-statistic-left"></div><div class="jfgrid-statistic-right" ></div></div>');
                        if (v.isPage) {
                            q.find("#jfgrid_footer_" + v.id).css({
                                height: 64,
                                "padding-top": "29px"
                            });
                            q.css({
                                "padding-bottom": "64px"
                            })
                        } else {
                            q.find("#jfgrid_footer_" + v.id).css({
                                height: 29
                            });
                            q.css({
                                "padding-bottom": "29px"
                            })
                        }
                        q.find("#jfgrid_toolbar_" + v.id).css({
                            width: "50px"
                        })
                    } else {
                        if (v.isEdit) {
                            q.find("#jfgrid_toolbar_" + v.id).css({
                                width: "100%"
                            })
                        }
                    }
                    v.running.headHeight = v.running.MaxDeep * 28 + 28;
                    v.running.headWidth = v.running.left;
                    var n = q.find("#jfgrid_border_" + v.id);
                    var p = q.find("#jfgrid_head_col_" + v.id);
                    if (v.isShowNum) {
                        n.append('<div class="jfgrid-border-cell jfgrid-border-num"></div>');
                        v.running.leftWidth += 30
                    }
                    if (v.isMultiselect) {
                        var o = a('<div class="jfgrid-border-cell jfgrid-border-cb"><img  id="jfgrid_all_cb_' + v.id + '" src="' + h + d[0] + '" /></div>').css({
                            left: v.running.leftWidth,
                            "line-height": (v.running.headHeight - 1) + "px"
                        });
                        n.append(o);
                        v.running.leftWidth += 30
                    }
                    if (v.isSubGrid) {
                        var s = a('<div class="jfgrid-border-cell jfgrid-border-sub"></div>').css("left", v.running.leftWidth);
                        n.append(s);
                        v.running.leftWidth += 30
                    }
                    v.running.leftWidth += v.running.frozenleft;
                    q.css({
                        "padding-top": v.running.headHeight
                    });
                    q.find("#jfgrid_head_" + v.id).css({
                        "padding-top": v.running.headHeight
                    });
                    n.css({
                        width: v.running.leftWidth,
                        height: v.running.headHeight
                    });
                    p.css({
                        width: v.running.headWidth,
                        height: v.running.headHeight,
                        left: v.running.leftWidth
                    });
                    q.find("#jfgrid_body_" + v.id + ">.lr-scroll-box").css({
                        "padding-left": v.running.leftWidth
                    });
                    q.find("#jfgrid_left_" + v.id).css({
                        width: v.running.leftWidth
                    });
                    m(q, v, false);
                    if (v.running.isStatistic) {
                        q.find("#jfgrid_statistic_" + v.id).css({
                            "padding-left": v.running.leftWidth
                        });
                        q.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-left").css({
                            width: v.running.leftWidth
                        })
                    }
                    var t = 0;
                    var r = null;
                    var u = true;
                    a.each(v.running.headData, function (w, x) {
                        if (x.last) {
                            x.height = x.height + (v.running.MaxDeep - x.deep) * 28
                        }
                        x.data.height = x.height;
                        x.$cell = a('<div class="jfgrid-head-cell" path="' + w + '"  ><span>' + (x.data.label || "") + "</span></div>").css({
                            top: x.top,
                            left: x.left,
                            width: (x._width || x.width),
                            height: x.height,
                            "line-height": (x.height - 1) + "px",
                            "text-align": (x.data.align || "left")
                        });
                        j.language.get((x.data.label || ""), function (y) {
                            x.data.label = y;
                            x.$cell.find("span").text(y)
                        });
                        if (x.last) {
                            x.$cell.append('<div class="jfgrid-heed-sort"><i class="fa fa-caret-up"></i><i class="fa fa-caret-down"></i></div>');
                            x.$cell.append('<div class="jfgrid-heed-move"></div>');
                            if (x.data.edit) {
                                i(q, v, x)
                            }
                            if (!x.frozen) {
                                t += (x._width || x.width)
                            }
                            if (v.running.isStatistic) {
                                if (x.data.statistics && u && r != null) {
                                    r.attr("isText", "1");
                                    r.css({
                                        "text-align": "right"
                                    });
                                    r.text("合计：");
                                    u = false
                                }
                                r = a('<div class="jfGird-statistic-cell"  name="' + x.data.name + '" ></div>').css({
                                    width: (x._width || x.width),
                                    "text-align": (x.data.align || "left"),
                                    left: x.left
                                });
                                if (x.frozen) {
                                    r.css({
                                        left: (x.left + v.running.leftWidth - v.running.frozenleft)
                                    });
                                    q.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-left").append(r)
                                } else {
                                    q.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-right").append(r)
                                }
                            }
                        }
                        if (x.frozen) {
                            x.$cell.css({
                                left: (x.left + v.running.leftWidth - v.running.frozenleft)
                            });
                            n.append(x.$cell)
                        } else {
                            p.append(x.$cell)
                        }
                    });
                    q.find("#jfgrid_right_" + v.id).parent().css({
                        width: v.running.leftWidth + t - 1
                    });
                    q.find("#jfgrid_right_" + v.id).css({
                        width: t - 1
                    });
                    if (v.running.isStatistic) {
                        q.find("#jfgrid_statistic_" + v.id + ">.jfgrid-statistic-right").css({
                            width: t - 1
                        })
                    }
                },
                dataRender: function (q, B, w, t) {
                    t = t || 0;
                    B.running.rowdata = [];
                    B.running.statisticData = {};
                    q.find("#jfgrid_left_" + B.id).find(".jfgrid-data-cell").remove();
                    q.find("#jfgrid_right_" + B.id).find(".jfgrid-data-cell").remove();
                    g();
                    var A = 3;
                    if (B.isTree) {
                        var E = c.listTotree(w, B);
                        if (E.length > 0) {
                            r(E, 1)
                        } else {
                        }

                        function r(F, G) {
                            a.each(F, function (H, I) {
                                c.rowRender(q, B, I, t, G);
                                if (I.childRows.length > 0) {
                                    r(I.childRows, G + 1)
                                }
                            })
                        }
                    } else {
                        a.each(w, function (F, G) {
                            c.rowRender(q, B, G, t);
                            if (B.multiselectfield && G[B.multiselectfield] == 1) {
                                if (A == 0) {
                                    A = 2
                                } else {
                                    if (A == 3) {
                                        A = 1
                                    }
                                }
                            } else {
                                if (B.multiselectfield && G[B.multiselectfield] == 0) {
                                    if (A == 1) {
                                        A = 2
                                    } else {
                                        if (A == 3) {
                                            A = 0
                                        }
                                    }
                                }
                            }
                        });
                        if (B.isPage) {
                            var n = a("#jfgrid_page_bar_" + B.id);
                            var o = n.find("#jfgrid_page_bar_num_" + B.id);
                            var p = n.find("#jfgrid_page_bar_nums_" + B.id);
                            var C = "";
                            var v = "";
                            if (B.rowdatas.length == 0) {
                                C = "无显示数据"
                            } else {
                                var D = B.running.pageparam;
                                var s = (D.page - 1) * D.rows + 1;
                                var x = s + B.rowdatas.length - 1;
                                C = "显示第 " + s + " - " + x + " 条记录  <span>|</span> 检索到 " + D.records + " 条记录";
                                if (D.total > 1) {
                                    var u = D.page - 6;
                                    u = u < 0 ? 0 : u;
                                    var y = u + 10;
                                    if (y > D.total) {
                                        y = D.total
                                    }
                                    if ((y - u) < 10) {
                                        u = y - 10
                                    }
                                    u = u < 0 ? 0 : u;
                                    for (var z = u; z < y; z++) {
                                        v += '<li><a href="javascript:void(0);" class=" pagebtn ' + ((z + 1) == D.page ? "active" : "") + '" >' + (z + 1) + "</a></li>"
                                    }
                                    p.find("span").text("共" + D.total + "页,到");
                                    p.show()
                                } else {
                                    p.hide()
                                }
                            }
                            o.html(v);
                            n.find(".jfgrid-page-bar-info").html(C)
                        }
                    }
                    if (B.isMultiselect) {
                        if (A == 2 || A == 1) {
                            q.find("#jfgrid_all_cb_" + B.id).attr("src", h + d[A])
                        } else {
                            q.find("#jfgrid_all_cb_" + B.id).attr("src", h + d[0])
                        }
                    }
                    if (B.running.rowdata.length > 0) {
                        q.find("#jfgrid_nodata_img_" + B.id).hide()
                    } else {
                        q.find("#jfgrid_nodata_img_" + B.id).show()
                    }
                },
                rowRender: function (q, B, t, y, z) {
                    var A = null;
                    var D = B.running.rowdata;
                    y = y || 0;
                    var o = q.find("#jfgrid_left_" + B.id);
                    var p = q.find("#jfgrid_right_" + B.id);
                    var s = D.length;
                    var x = s * B.rowHeight;
                    var u = 0;
                    var C = {};
                    var n = null;
                    if (B.isTree) {
                        C.jfgridRowData = t.data;
                        C.childRows = t.childRows;
                        C.jfdeep = z;
                        t = t.data;
                        n = a('<div class="jfgrid-data-cell-expend" style="width:' + (z * 16) + 'px;" ></div>');
                        if (C.childRows.length > 0) {
                            n.append('<i class="fa fa-caret-down jfgrid-data-cell-expendi"></i>')
                        }
                        B.rowdatas[s] = t
                    } else {
                        C.jfgridRowData = t
                    }
                    C.jfnum = {
                        top: x,
                        left: u,
                        value: s + 1,
                        text: s + y * (B.isPage ? B.running.pageparam.rows : 1) + 1
                    };
                    if (B.isShowNum) {
                        C.jfnum.$cell = a('<div class="jfgrid-data-cell" rowindex="' + s + '" rownum="' + B.id + "_" + s + '" colname="jfgrid_num"  >' + (s + y * (B.isPage ? B.running.pageparam.rows : 1) + 1) + "</div>");
                        C.jfnum.$cell.css({
                            top: C.jfnum.top,
                            left: C.jfnum.left,
                            "text-align": "center",
                            height: B.rowHeight,
                            "line-height": (B.rowHeight - 1) + "px"
                        });
                        o.append(C.jfnum.$cell);
                        u += 30
                    }
                    if (B.isMultiselect) {
                        var r = B.multiselectfield || "jfcheck";
                        C.jfcheck = {
                            top: x,
                            left: u,
                            value: t[r] || 0,
                            $cell: a('<div class="jfgrid-data-cell" rowindex="' + s + '" rownum="' + B.id + "_" + s + '" colname="jfgrid_check"  ><img src="' + h + d[0] + '" /></div>')
                        };
                        if (C.jfcheck.value + "" == "1") {
                            C.jfcheck.$cell.find("img").attr("src", h + d[1])
                        }
                        C.jfcheck.$cell.css({
                            top: C.jfcheck.top,
                            left: C.jfcheck.left,
                            "text-align": "center",
                            height: B.rowHeight,
                            "line-height": (B.rowHeight - 1) + "px"
                        });
                        o.append(C.jfcheck.$cell);
                        u += 30
                    }
                    if (B.isSubGrid) {
                        C.jfsubGrid = {
                            top: x,
                            left: u,
                            value: false,
                            $cell: a('<div class="jfgrid-data-cell"  rowindex="' + s + '"  rownum="' + B.id + "_" + s + '" colname="jfgrid_subGrid"  ><i class="fa fa-plus" ></i></div>')
                        };
                        C.jfsubGrid.$cell.css({
                            top: C.jfsubGrid.top,
                            left: C.jfsubGrid.left,
                            "text-align": "center",
                            height: B.rowHeight,
                            "line-height": (B.rowHeight - 1) + "px"
                        });
                        o.append(C.jfsubGrid.$cell);
                        u += 30
                    }
                    a.each(B.running.frozenCols, function (E, G) {
                        var H = t[G.data.name];
                        var F = (G.data._width || G.data.width);
                        C[G.data.name] = {
                            top: x,
                            left: u,
                            value: H,
                            $cell: a('<div class="jfgrid-data-cell" rowindex="' + s + '" rownum="' + B.id + "_" + s + '" colname="' + G.data.name + '"  ></div>')
                        };
                        e(H, G.data, t, C[G.data.name], B);
                        C[G.data.name].$cell.css({
                            top: C[G.data.name].top,
                            left: C[G.data.name].left,
                            "text-align": G.data.align,
                            width: F,
                            height: B.rowHeight,
                            "line-height": (B.rowHeight - 1) + "px"
                        });
                        o.append(C[G.data.name].$cell);
                        u += F;
                        if (n != null && E == 0) {
                            C[G.data.name].$cell.prepend(n)
                        }
                        A = C[G.data.name]
                    });
                    u = 0;
                    a.each(B.running.cols, function (E, G) {
                        var H = t[G.data.name];
                        var F = (G._width || G.width);
                        C[G.data.name] = {
                            top: x,
                            left: u,
                            value: H,
                            $cell: a('<div class="jfgrid-data-cell" rowindex="' + s + '" rownum="' + B.id + "_" + s + '" colname="' + G.data.name + '"  ></div>')
                        };
                        e(H, G.data, t, C[G.data.name], B);
                        C[G.data.name].$cell.css({
                            top: C[G.data.name].top,
                            left: C[G.data.name].left,
                            "text-align": G.data.align,
                            width: F,
                            height: B.rowHeight,
                            "line-height": (B.rowHeight - 1) + "px"
                        });
                        p.append(C[G.data.name].$cell);
                        u += F;
                        if (n != null && E == 0 && B.running.frozenCols.length == 0) {
                            C[G.data.name].$cell.prepend(n)
                        }
                        A = C[G.data.name]
                    });
                    D.push(C);
                    p.css({
                        height: x + B.rowHeight - 1
                    });
                    if (B.isAutoHeight) {
                        var w = q.css("padding-top");
                        var v = q.css("padding-bottom");
                        q.css({
                            height: x + B.rowHeight + parseInt(w) + parseInt(v) + 1
                        })
                    }
                    if (B.running.rowSelected && A) {
                        if (B.running.rowSelected.jfgridRowData[B.mainId]) {
                            B.running.rowSelected.jfgridRowData[B.mainId] == C.jfgridRowData[B.mainId] && (A.$cell.trigger("click"))
                        } else {
                            B.running.rowSelected.jfnum.value == C.jfnum.value && (A.$cell.trigger("click"))
                        }
                    }
                },
                updateRow: function (p, o) {
                    var n = {};
                    a.each(o.running.headData, function (r, q) {
                        n[q.data.name] = q.data
                    });
                    a.each(p, function (r, q) {
                        if (r != "jfnum" && r != "jfcheck" && r != "jfsubGrid" && r != "jfgridRowData") {
                            if (q.value != p.jfgridRowData[r]) {
                                q.value = p.jfgridRowData[r] || "";
                                e(q.value, n[r], p.jfgridRowData, q, o)
                            }
                        }
                    })
                },
                reload: function (n, p) {
                    p.rowdatas = [];
                    if (p.isPage) {
                        j.loading(true, "正在获取数据");
                        p.running.pageparam = p.running.pageparam || {
                            rows: 100,
                            page: 1,
                            sidx: "",
                            sord: "",
                            records: 0,
                            total: 0
                        };
                        p.running.pageparam.rows = p.rows;
                        p.running.pageparam.sidx = p.sidx;
                        p.running.pageparam.sord = p.sord;
                        p.running.pageparam.page = p.running.pageparam.page || 1;
                        p.running.pageparam.records = 0;
                        p.running.pageparam.total = 0;
                        p.param = p.param || {};
                        delete p.param.pagination;
                        var o = JSON.stringify(p.param);
                        if (p.running.paramString != o) {
                            p.running.paramString = o;
                            p.running.pageparam.page = 1
                        }
                        p.param.pagination = JSON.stringify(p.running.pageparam);
                        j.httpAsync("GET", p.url, p.param, function (q) {
                            j.loading(false);
                            if (q) {
                                p.rowdatas = q.rows;
                                p.running.pageparam.page = q.page;
                                p.running.pageparam.records = q.records;
                                p.running.pageparam.total = q.total
                            } else {
                                p.rowdatas = [];
                                p.running.pageparam.page = 1;
                                p.running.pageparam.records = 0;
                                p.running.pageparam.total = 0
                            }
                            c.dataRender(n, p, p.rowdatas, (p.running.pageparam.page - 1));
                            p.onRenderComplete && p.onRenderComplete(p.rowdatas)
                        })
                    } else {
                        j.loading(true, "正在获取数据");
                        j.httpAsync("GET", p.url, p.param, function (q) {
                            j.loading(false);
                            p.rowdatas = q || [];
                            c.dataRender(n, p, p.rowdatas, 0);
                            p.onRenderComplete && p.onRenderComplete(p.rowdatas)
                        })
                    }
                },
                listTotree: function (o, v) {
                    var x = [];
                    var t = {};
                    var u = {};
                    var w = {};
                    o = o || [];
                    for (var p = 0, s = o.length; p < s; p++) {
                        var r = o[p];
                        u[r[v.mainId]] = 1;
                        t[r[v.parentId]] = t[r[v.parentId]] || [];
                        t[r[v.parentId]].push(r);
                        if (u[r[v.parentId]] == 1) {
                            delete w[r[v.parentId]]
                        } else {
                            w[r[v.parentId]] = 1
                        }
                        if (w[r[v.mainId]] == 1) {
                            delete w[r[v.mainId]]
                        }
                    }
                    for (var q in w) {
                        n(x, q)
                    }

                    function n(y, D) {
                        var C = t[D] || [];
                        for (var A = 0, B = C.length; A < B; A++) {
                            var z = {
                                data: C[A],
                                childRows: []
                            };
                            n(z.childRows, C[A][v.mainId]);
                            y.push(z)
                        }
                    }

                    return x
                },
                expandTree: function (n, t) {
                    var o = 0;
                    var q = false;
                    var w = n.parents(".jfgrid-data-cell").attr("rownum");
                    var u = parseInt(w.replace(t.id + "_", ""));
                    var v = t.running.rowdata[u];
                    if (n.hasClass("fa-caret-down")) {
                        v.lrClosedRows = {};
                        for (var r = u + 1, s = t.running.rowdata.length; r < s; r++) {
                            var p = t.running.rowdata[r];
                            if (p.jfdeep > v.jfdeep && !q) {
                                if (!a('[rownum="' + t.id + "_" + r + '"]').is(":hidden")) {
                                    o += t.rowHeight;
                                    a('[rownum="' + t.id + "_" + r + '"]').hide();
                                    v.lrClosedRows[r] = "1"
                                }
                            } else {
                                q = true;
                                var x = parseInt(a('[rownum="' + t.id + "_" + r + '"]').eq(0).css("top").replace("px", "")) - o;
                                a('[rownum="' + t.id + "_" + r + '"]').css({
                                    top: x
                                })
                            }
                        }
                        n.removeClass("fa-caret-down");
                        n.addClass("fa-caret-right")
                    } else {
                        for (var r = u + 1, s = t.running.rowdata.length; r < s; r++) {
                            var p = t.running.rowdata[r];
                            if (p.jfdeep > v.jfdeep && !q) {
                                if (v.lrClosedRows[r]) {
                                    o += t.rowHeight;
                                    a('[rownum="' + t.id + "_" + r + '"]').show()
                                }
                            } else {
                                q = true;
                                var x = parseInt(a('[rownum="' + t.id + "_" + r + '"]').eq(0).css("top").replace("px", "")) + o;
                                a('[rownum="' + t.id + "_" + r + '"]').css({
                                    top: x
                                })
                            }
                        }
                        n.removeClass("fa-caret-right");
                        n.addClass("fa-caret-down")
                    }
                    a("#jfgrid_left_" + t.id + " .jfgrid-selected,#jfgrid_right_" + t.id + " .jfgrid-selected").removeClass("jfgrid-selected");
                    t.running.rowSelected = null
                },
                sortCol: function (p, n, s) {
                    var t = n.attr("path");
                    var q = s.running.headData[t];
                    if (q.last && (q.data.sort === true || q.data.sort === undefined) && s.isPage) {
                        var r = true;
                        if (s.running.sorthead) {
                            s.running.sorthead.$cell.find(".jfgrid-heed-sort").hide();
                            if (q == s.running.sorthead) {
                                var o = q.$cell.find(".jfgrid-heed-sort .active");
                                o.removeClass("active");
                                if (o.hasClass("fa-caret-up")) {
                                    q.$cell.find(".jfgrid-heed-sort .fa-caret-down").addClass("active");
                                    r = false
                                } else {
                                    q.$cell.find(".jfgrid-heed-sort .fa-caret-up").addClass("active");
                                    r = true
                                }
                                q.$cell.find(".jfgrid-heed-sort").show()
                            } else {
                                q.$cell.find(".jfgrid-heed-sort .active").removeClass("active");
                                q.$cell.find(".jfgrid-heed-sort .fa-caret-up").addClass("active");
                                q.$cell.find(".jfgrid-heed-sort").show();
                                r = true
                            }
                        } else {
                            q.$cell.find(".jfgrid-heed-sort .active").removeClass("active");
                            q.$cell.find(".jfgrid-heed-sort .fa-caret-up").addClass("active");
                            q.$cell.find(".jfgrid-heed-sort").show();
                            r = true
                        }
                        s.running.sorthead = q;
                        if (s.isPage) {
                            s.sidx = q.data.name;
                            s.sord = r ? "ASC" : "DESC";
                            c.reload(p, s)
                        } else {
                        }
                    }
                    console.log(q)
                },
                clickRow: function (p, o, u) {
                    var n = o;
                    var y = o.attr("rownum");
                    if (!y) {
                        n = o.parents(".jfgrid-data-cell");
                        y = n.attr("rownum")
                    }
                    var w = parseInt(y.replace(u.id + "_", ""));
                    var x = u.running.rowdata[w];
                    var v = x.jfgridRowData;
                    var s = n.attr("colname");
                    var t = false;
                    a.each(u.running.headData, function (I, H) {
                        if (H.data.name == s) {
                            if (H.data.edit && H.data.edit.type != "layer") {
                                t = true;
                                var F = n.css("top");
                                var D = n.css("left");
                                var G = n.css("width");
                                H.$edit.css({
                                    top: F,
                                    left: D,
                                    width: G,
                                    height: u.rowHeight
                                }).show();
                                var z = H.$edit.find("#jfgrid_edit_" + u.id + "_" + H.data.name);
                                z.unbind("change");
                                H.data.edit.init && H.data.edit.init(v, z);
                                switch (H.data.edit.type) {
                                    case "input":
                                        z.unbind("input propertychange");
                                        z.val(v[s] || "");
                                        z.select();
                                        z.on("input propertychange", function (J) {
                                            var K = a(this).val();
                                            v[s] = K;
                                            H.data.edit.change && H.data.edit.change(v, w);
                                            e(K, H.data, v, x[H.data.name], u)
                                        });
                                        break;
                                    case "select":
                                        z.lrselectSet(v[s] || "");
                                        z.on("change", function () {
                                            var J = a(this);
                                            var L = J.lrselectGet();
                                            var K = J.lrselectGetEx();
                                            v[s] = L;
                                            H.data.edit.change && H.data.edit.change(v, w, K);
                                            e(L, H.data, v, x[H.data.name], u)
                                        });
                                        break;
                                    case "radio":
                                        z.find("input").unbind("click");
                                        z.find('input[value="' + (v[s] || "") + '"]').trigger("click");
                                        z.find("input").on("click", function () {
                                            var J = a(this).val();
                                            if (v[s] != J) {
                                                v[s] = J;
                                                H.data.edit.change && H.data.edit.change(v, w);
                                                e(J, H.data, v, x[H.data.name], u)
                                            }
                                        });
                                        if ((v[s] == "" || v[s] == null || v[s] == undefined) && H.data.edit.dfvalue) {
                                            z.find('input[value="' + H.data.edit.dfvalue + '"]').trigger("click")
                                        }
                                        break;
                                    case "checkbox":
                                        z.find("input").unbind("click");
                                        var E = v[s] || "";
                                        var A = {};
                                        var B = v[s] || H.data.edit.dfvalue || "";
                                        v[s] = B;
                                        var C = B.split(",");
                                        a.each(C, function (J, K) {
                                            A[K] = "1"
                                        });
                                        z.find("input").each(function () {
                                            var J = a(this);
                                            var K = J.val();
                                            if (J.is(":checked") && !A[K]) {
                                                J.trigger("click")
                                            } else {
                                                if (!J.is(":checked") && A[K]) {
                                                    J.trigger("click")
                                                }
                                            }
                                            J = null
                                        });
                                        if (E != v[s]) {
                                            H.data.edit.change && H.data.edit.change(v, w);
                                            e(v[s], H.data, v, x[H.data.name], u)
                                        }
                                        z.find("input").on("click", function () {
                                            var J = a(this);
                                            var N = J.val();
                                            var K = v[s].split(",");
                                            var L = {};
                                            var M = [];
                                            a.each(K, function (O, P) {
                                                if (P !== "" && P !== undefined && P !== null) {
                                                    L[P] = O;
                                                    M.push(P)
                                                }
                                            });
                                            if (J.is(":checked")) {
                                                if (L[N] == undefined) {
                                                    M.push(N)
                                                }
                                            } else {
                                                if (L[N] != undefined) {
                                                    M.splice(L[N], 1)
                                                }
                                            }
                                            v[s] = String(M);
                                            H.data.edit.change && H.data.edit.change(v, w);
                                            e(v[s], H.data, v, x[H.data.name], u)
                                        });
                                        break;
                                    case "datatime":
                                        z.unbind("change");
                                        z.val(v[s] || "");
                                        z.select();
                                        z.on("change", function (J) {
                                            var K = a(this).val();
                                            v[s] = K;
                                            H.data.edit.change && H.data.edit.change(v, w);
                                            e(K, H.data, v, x[H.data.name], u)
                                        });
                                        break;
                                    case "layer":
                                        break
                                }
                            }
                            return false
                        }
                    });
                    if (!t) {
                        if (u.isMultiselect) {
                            var q = x.jfcheck.value;
                            if ((q + "") == "1") {
                                x.jfcheck.$cell.find("img").attr("src", h + d[0]);
                                x.jfcheck.value = 0;
                                u.multiselectfield && (v[u.multiselectfield] = 0);
                                u.onSelectRow && u.onSelectRow(v, false);
                                if (!u.running.checkAlling) {
                                    var r = false;
                                    a.each(u.running.rowdata, function (z, A) {
                                        if (A.jfcheck.value + "" == "1") {
                                            r = true;
                                            return false
                                        }
                                    });
                                    if (r) {
                                        p.find("#jfgrid_all_cb_" + u.id).attr("src", h + d[2])
                                    } else {
                                        p.find("#jfgrid_all_cb_" + u.id).attr("src", h + d[0])
                                    }
                                }
                            } else {
                                x.jfcheck.$cell.find("img").attr("src", h + d[1]);
                                x.jfcheck.value = 1;
                                u.multiselectfield && (v[u.multiselectfield] = 1);
                                u.onSelectRow && u.onSelectRow(v, true);
                                if (!u.running.checkAlling) {
                                    var r = false;
                                    a.each(u.running.rowdata, function (z, A) {
                                        if (A.jfcheck.value + "" == "0") {
                                            r = true;
                                            return false
                                        }
                                    });
                                    if (r) {
                                        p.find("#jfgrid_all_cb_" + u.id).attr("src", h + d[2])
                                    } else {
                                        p.find("#jfgrid_all_cb_" + u.id).attr("src", h + d[1])
                                    }
                                }
                            }
                        } else {
                            p.find("#jfgrid_left_" + u.id + " .jfgrid-selected,#jfgrid_right_" + u.id + " .jfgrid-selected").removeClass("jfgrid-selected");
                            p.find('[rownum="' + y + '"]').addClass("jfgrid-selected");
                            u.onSelectRow && u.onSelectRow(v);
                            u.running.rowSelected = x
                        }
                    } else {
                        p.find("#jfgrid_left_" + u.id + " .jfgrid-selected,#jfgrid_right_" + u.id + " .jfgrid-selected").removeClass("jfgrid-selected");
                        u.running.rowSelected = null
                    }
                },
                checkAllRows: function (o, n, r) {
                    var p = n.attr("src").replace(h, "");
                    var q = false;
                    if (p == d[1]) {
                        q = true;
                        n.attr("src", h + d[0])
                    } else {
                        n.attr("src", h + d[1])
                    }
                    r.running.checkAlling = true;
                    a.each(r.running.rowdata, function (s, t) {
                        if (t.jfcheck.value + "" == "0" && !q) {
                            t.jfcheck.$cell.trigger("click")
                        } else {
                            if (t.jfcheck.value + "" == "1" && q) {
                                t.jfcheck.$cell.trigger("click")
                            }
                        }
                    });
                    r.running.checkAlling = false
                },
                expandSub: function (s, p, y) {
                    var o = p;
                    var C = p.attr("rownum");
                    if (!C) {
                        o = p.parents(".jfgrid-data-cell");
                        C = o.attr("rownum")
                    }
                    var A = parseInt(C.replace(y.id + "_", ""));
                    var B = y.running.rowdata[A];
                    var z = B.jfgridRowData;
                    var n = s.find("#jfgrid_body_" + y.id);
                    var q = s.find("#jfgrid_left_" + y.id);
                    var r = s.find("#jfgrid_right_" + y.id);
                    var E = y.id + "_sub_" + A;
                    var u = q.height();
                    if (B.jfsubGrid.value) {
                        B.jfsubGrid.value = false;
                        var t = a("#" + E);
                        t.remove();
                        B.jfsubGrid.$cell.html('<i class="fa fa-plus" ></i>');
                        for (var v = A + 1, x = y.running.rowdata.length; v < x; v++) {
                            var w = y.running.rowdata[v];
                            a.each(w, function (G, H) {
                                if (H.top != undefined) {
                                    H.top = H.top - y.subGridHeight;
                                    H.$cell.css({
                                        top: H.top
                                    })
                                }
                            })
                        }
                        q.css({
                            height: u - y.subGridHeight
                        });
                        r.css({
                            height: u - y.subGridHeight
                        })
                    } else {
                        B.jfsubGrid.value = true;
                        var F = n.width();
                        B.jfsubGrid.$cell.html('<i class="fa fa-minus" ></i>');
                        var D = j.newGuid();
                        var t = a('<div class="jfgrid-sub" id="' + E + '" ><div id="' + D + '" ></div></div>').css({
                            left: 0,
                            top: B.jfsubGrid.top + y.rowHeight,
                            height: y.subGridHeight,
                            width: F
                        });
                        for (var v = A + 1, x = y.running.rowdata.length; v < x; v++) {
                            var w = y.running.rowdata[v];
                            a.each(w, function (G, H) {
                                if (H.top != undefined) {
                                    H.top += y.subGridHeight;
                                    H.$cell.css({
                                        top: H.top
                                    })
                                }
                            })
                        }
                        q.append(t);
                        q.css({
                            height: u + y.subGridHeight
                        });
                        r.css({
                            height: u + y.subGridHeight
                        });
                        y.subGridExpanded && y.subGridExpanded(D, B.jfgridRowData)
                    }
                },
                getCheckRow: function (n, o) {
                    var p = [];
                    a.each(o.running.rowdata, function (q, r) {
                        if (r.jfcheck.value == 1) {
                            p.push(r.jfgridRowData)
                        }
                    });
                    return p
                },
                moveUp: function (n, s, r) {
                    if (r > 0) {
                        var p = true;
                        var o = s.rowdatas[r];
                        if (s.isTree) {
                            p = false;
                            if (s.running.rowdata[r].jfdeep <= s.running.rowdata[r - 1].jfdeep) {
                                for (var q = r - 1; q >= 0; q--) {
                                    if (s.running.rowdata[r].jfdeep == s.running.rowdata[q].jfdeep) {
                                        p = true;
                                        s.rowdatas[r] = s.rowdatas[q];
                                        s.rowdatas[q] = o;
                                        break
                                    }
                                }
                            }
                        } else {
                            s.rowdatas[r] = s.rowdatas[r - 1];
                            s.rowdatas[r - 1] = o
                        }
                        c.dataRender(n, s, s.rowdatas);
                        return true
                    }
                    return false
                },
                moveDown: function (n, t, r) {
                    if (r < t.rowdatas.length - 1) {
                        var p = true;
                        var o = t.rowdatas[r];
                        if (t.isTree) {
                            p = false;
                            for (var q = r + 1, s = t.rowdatas.length; q < s; q++) {
                                if (t.running.rowdata[r].jfdeep > t.running.rowdata[q].jfdeep) {
                                    break
                                }
                                if (t.running.rowdata[r].jfdeep == t.running.rowdata[q].jfdeep) {
                                    p = true;
                                    t.rowdatas[r] = t.rowdatas[q];
                                    t.rowdatas[q] = o;
                                    break
                                }
                            }
                        } else {
                            t.rowdatas[r] = t.rowdatas[r + 1];
                            t.rowdatas[r + 1] = o
                        }
                        c.dataRender(n, t, t.rowdatas);
                        return true
                    }
                    return false
                },
                turnPage: function (q) {
                    var p = a(this);
                    var o = a("#" + p.attr("id").replace("jfgrid_page_bar_num_", ""));
                    var s = o[0].dfop;
                    var r = q.target || q.srcElement;
                    var n = a(r);
                    if (n.hasClass("pagebtn")) {
                        var t = parseInt(n.text());
                        if (t != s.running.pageparam.page) {
                            p.find(".active").removeClass("active");
                            n.addClass("active");
                            s.running.pageparam.page = t;
                            c.reload(o, s)
                        }
                    }
                },
                turnPage2: function (q) {
                    var o = a(this);
                    var t = q.data.op;
                    var s = o.text();
                    var n = a("#jfgrid_page_bar_num_" + t.id);
                    var v = parseInt(n.find(".active").text());
                    var r = false;
                    switch (s) {
                        case "首页":
                            if (v != 1) {
                                t.running.pageparam.page = 1;
                                r = true
                            }
                            break;
                        case "上一页":
                            if (v > 1) {
                                t.running.pageparam.page = v - 1;
                                r = true
                            }
                            break;
                        case "下一页":
                            if (v < t.running.pageparam.total) {
                                t.running.pageparam.page = v + 1;
                                r = true
                            }
                            break;
                        case "尾页":
                            if (v != t.running.pageparam.total) {
                                t.running.pageparam.page = t.running.pageparam.total;
                                r = true
                            }
                            break;
                        case "跳转":
                            var w = o.parents("#jfgrid_page_bar_nums_" + t.id).find("input").val();
                            if (!!w) {
                                var u = parseInt(w);
                                if (String(u) != "NaN") {
                                    if (u < 1) {
                                        u = 1
                                    }
                                    if (u > t.running.pageparam.total) {
                                        u = t.running.pageparam.total
                                    }
                                    t.running.pageparam.page = u;
                                    r = true
                                }
                            }
                            break
                    }
                    if (r) {
                        c.reload(a("#" + t.id), t)
                    }
                },
                print: function (n) {
                    var q = n[0].dfop;
                    var o = a('<table border="1" style=""></table>');
                    var r = [];

                    function p(s, t) {
                        var u = s.length;
                        a.each(s, function (x, y) {
                            r[t] = r[t] || a("<tr></tr>");
                            var v = a("<th>" + y.label + "</th>");
                            if (!!y.children && y.children.length > 0) {
                                var z = p(y.children, t + 1);
                                u = u + z - 1;
                                v.attr("colspan", z)
                            }
                            var w = y.height / 28;
                            v.attr("rowspan", w);
                            v.css("text-align", y.align);
                            r[t].append(v)
                        });
                        return u
                    }

                    p(q.headData, 0);
                    a.each(r, function (s, t) {
                        o.append(t)
                    });
                    a.each(q.rowdatas, function (t, u) {
                        var s = a("<tr></tr>");
                        n.find('[rownum="' + q.id + "_" + t + '"]').each(function () {
                            var v = a(this);
                            var x = v.attr("colname");
                            if (!!x && x != "jfgrid_num" && x != "jfgrid_multiselect" && x != "jfgrid_subGrid") {
                                var w = a("<td>" + v.html() + "</td>");
                                w.css("text-align", v.css("text-align"));
                                s.append(w)
                            }
                        });
                        o.append(s)
                    });
                    q = null;
                    return o
                }
            };
            a.fn.jfGrid = function (s) {
                var n = a(this);
                if (!n[0] || n[0].dfop) {
                    return n
                }
                var q = n.attr("id");
                if (q == null || q == undefined || q == "") {
                    q = "jfgrid" + new Date().getTime();
                    n.attr("id", q)
                }
                var o = {
                    url: "",
                    param: {},
                    rowdatas: [],
                    headData: [],
                    isShowNum: true,
                    isMultiselect: false,
                    multiselectfield: "",
                    isSubGrid: false,
                    subGridExpanded: false,
                    subGridHeight: 300,
                    onSelectRow: false,
                    dblclick: false,
                    onRenderComplete: false,
                    onAddRow: false,
                    onMinusRow: false,
                    beforeMinusRow: false,
                    isPage: false,
                    rows: 100,
                    sidx: "",
                    sord: "ASC",
                    isTree: false,
                    mainId: "id",
                    parentId: "parentId",
                    isEdit: false,
                    isAutoHeight: false,
                    height: 0,
                    rowHeight: 28
                };
                if (!!s) {
                    a.extend(o, s)
                }
                o.id = q;
                n[0].dfop = o;
                o.running = {};
                if (o.isMultiselect) {
                    for (var p = 0; p < 3; p++) {
                        var r = new Image();
                        r.src = h + d[p]
                    }
                }
                c.init(n, o);
                o = null;
                return n
            };
            a.fn.jfGridSet = function (r, p) {
                var n = a(this);
                var q = n[0].dfop;
                if (!q) {
                    return null
                }
                switch (r) {
                    case "reload":
                        if (p == undefined || p == null) {
                            c.reload(n, q)
                        } else {
                            p = p || q.param || {};
                            q.param = p.param || p;
                            c.reload(n, q)
                        }
                        break;
                    case "refresh":
                        break;
                    case "refreshdata":
                        if (p) {
                            q.rowdatas = p.rowdatas || p
                        }
                        c.dataRender(n, q, q.rowdatas);
                        break;
                    case "addRow":
                        q.rowdatas.push(p || {});
                        c.rowRender(n, q, p || {}, 0);
                        n.find("#jfgrid_nodata_img_" + q.id).hide();
                        break;
                    case "removeRow":
                        a.each(q.rowdatas, function (s, t) {
                            if (q.mainId && p) {
                                if (t[q.mainId] == p) {
                                    q.rowdatas.splice(s, 1);
                                    return false
                                }
                            } else {
                                if (t == q.running.rowSelected.jfgridRowData) {
                                    q.rowdatas.splice(s, 1);
                                    return false
                                }
                            }
                        });
                        var o = n;
                        setTimeout(function () {
                            c.dataRender(o, o[0].dfop, o[0].dfop.rowdatas, 0);
                            o = null
                        }, 100);
                        break;
                    case "nocheck":
                        if (q.isMultiselect) {
                            a.each(q.running.rowdata, function (s, t) {
                                if (t.jfgridRowData[q.mainId] == p) {
                                    if (t.jfcheck.value == 1) {
                                        t.jfcheck.$cell.trigger("click")
                                    }
                                    return false
                                }
                            })
                        }
                        break;
                    case "updateRow":
                        if (q.running.rowSelected) {
                            c.updateRow(q.running.rowSelected, q)
                        } else {
                            if (q.running.rowdata[p]) {
                                c.updateRow(q.running.rowdata[p], q)
                            }
                        }
                        break;
                    case "moveUp":
                        return c.moveUp(n, q, p);
                        break;
                    case "moveDown":
                        return c.moveDown(n, q, p);
                        break
                }
                q = null;
                n = null
            };
            a.fn.jfGridGet = function (o) {
                var n = a(this);
                var p = n[0].dfop;
                if (!p) {
                    return null
                }
                switch (o) {
                    case "rowdata":
                        if (p.isMultiselect) {
                            return c.getCheckRow(n, p)
                        } else {
                            if (p.running.rowSelected) {
                                if (p.running.rowdata[p.running.rowSelected.jfnum.value - 1] && p.running.rowSelected.jfgridRowData == p.running.rowdata[p.running.rowSelected.jfnum.value - 1].jfgridRowData) {
                                    return p.running.rowSelected.jfgridRowData
                                } else {
                                    p.running.rowSelected = null;
                                    return {}
                                }
                            } else {
                                return {}
                            }
                        }
                        break;
                    case "rowdatas":
                        return p.rowdatas;
                        break;
                    case "rowdatasByArray":
                        break;
                    case "settingInfo":
                        return p;
                        break;
                    case "headData":
                        break;
                    case "showData":
                        var q = [];
                        a.each(p.running.rowdata, function (r, s) {
                            var t = {};
                            a.each(s, function (u, v) {
                                if (u != "jfgridRowData" && u != "jfnum" && u != "jfcheck" && u != "jfsubGrid") {
                                    t[u] = v.text
                                }
                            });
                            q.push(t)
                        });
                        return q;
                        break
                }
                p = null
            };
            a.fn.jfGridValue = function (p) {
                var n = a(this);
                var q = n[0].dfop;
                if (!q) {
                    return null
                }
                if (q.isMultiselect) {
                    var r = [];
                    var o = c.getCheckRow(n, q);
                    a.each(o, function (s, t) {
                        r.push(t[p])
                    });
                    return String(r)
                } else {
                    if (q.running.rowSelected) {
                        if (q.running.rowdata[q.running.rowSelected.jfnum.value - 1] && q.running.rowSelected.jfgridRowData == q.running.rowdata[q.running.rowSelected.jfnum.value - 1].jfgridRowData) {
                            return q.running.rowSelected.jfgridRowData[p]
                        } else {
                            q.running.rowSelected = null;
                            return ""
                        }
                    } else {
                        return ""
                    }
                }
            };
            a.fn.jfGridPrint = function () {
                var n = a(this);
                return c.print(n)
            }
        })(window.jQuery, top.learun);


    </script>

    <script>
        $.lrToken = $('<input name="__RequestVerificationToken" type="hidden" value="7q7BvfySd_BRboCOsevq42jEF5iAC0pZWAzwrRTWFXtor9Ua2qmzq8bG4CiUq6lbrwe7S8hQ8Ln5pPJLRVbSSiMfnZkLs9ToEHMcqiNptKg1" />').val();
        $(function () {
            $('#lr_form_bg').fadeOut();
            $('#form').lrscroll();

            // 翻译指定标签
            $('.lrlg').each(function () {
                var $this = $(this);
                top.learun.language.get($this.text(), function (text) {
                    $this.text(text);
                });
            });
            // 翻译表单标题
            $('.lr-form-item-title').each(function () {
                var $this = $(this);
                var $font = $this.find('font');
                $font.remove();
                top.learun.language.get($this.text(), function (text) {
                    if ($font.length > 0) {
                        $this.html(text + '<font face="宋体">*</font>');
                    } else {
                        $this.text(text);
                    }

                });
            });
            // input placeholder 翻译
            $('input[placeholder]').each(function () {
                var $this = $(this);
                var _text = $this.attr('placeholder');
                top.learun.language.get(_text, function (text) {
                    $this.attr('placeholder', text);
                });
            });

            if (!!window.bootstrap) {
                bootstrap(jQuery, top.learun);
            }
        });
    </script>
</body>

</html>